/**
 * ================================================================
 * Calendrier de l'Avent Crowdaa - Mobile-First Architecture
 * Version: 3.12.0
 * ================================================================
 *
 * Design inspiré Framework7/Cordova pour UX mobile optimale
 * Mobile-first responsive: <768px (base) → 768px+ (tablet) → 1024px+ (desktop)
 */

/* ================================================================
1. CSS VARIABLES - Design Tokens
================================================================ */
:root {
    /* ===== Colors - Injectées dynamiquement par calendar-template.php (v3.9.5) ===== */
    /* Les variables --cal-* sont définies dans <style id="crowdaa-calendar-colors"> */
    /* Fallback uniquement si calendar-template n'est pas chargé */

    /* Colors - Héritage admin ou valeurs par défaut */
    --cal-primary: #667eea; /* v3.9.5 - Fallback simplifié */
    --cal-secondary: #764ba2; /* v3.9.5 - Fallback simplifié */
    --cal-gold: #FFD700; /* v3.9.5 - Fallback simplifié */
    --cal-success: #7ED957; /* v3.9.5 - Fallback simplifié */
    --cal-danger: #ff4757; /* v3.9.5 - Fallback simplifié */
    --cal-locked: #95a5a6; /* v3.9.5 - Fallback simplifié */
    --cal-unlocked: #ffffff; /* v3.9.5 - Fallback simplifié */
    --cal-completed: #d4edda; /* v3.9.5 - Fallback simplifié */

    /* Colors - Complémentaires fixes */
    --cal-dark-blue: #2B3674;
    --cal-light-blue: #E8ECFF;
    --cal-warning: #FFAB00;
    --cal-white: #FFFFFF;
    --cal-snow: #F0F4FF;
    --cal-text: #2B3674;
    --cal-text-light: #A3AED0;
    --cal-text-muted: #6B7280;

    /* ===== Typography ===== */
    --cal-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cal-font-size-xs: 12px;
    --cal-font-size-sm: 14px;
    --cal-font-size-base: 16px;
    --cal-font-size-lg: 18px;
    --cal-font-size-xl: 24px;
    --cal-font-size-2xl: 32px;
    --cal-font-size-3xl: 48px;
    --cal-font-size-4xl: 64px;
    --cal-font-weight-normal: 400;
    --cal-font-weight-medium: 500;
    --cal-font-weight-semibold: 600;
    --cal-font-weight-bold: 700;
    --cal-line-height-tight: 1.2;
    --cal-line-height-normal: 1.5;
    --cal-line-height-relaxed: 1.75;

    /* ===== Spacing - Mobile-first (cohérent) ===== */
    --cal-spacing-xs: 8px;
    --cal-spacing-sm: 12px;
    --cal-spacing-md: 16px;
    --cal-spacing-lg: 24px;
    --cal-spacing-xl: 32px;
    --cal-spacing-2xl: 48px;
    --cal-spacing-3xl: 64px;

    /* Legacy spacing (rétrocompatibilité) */
    --spacing-xs: var(--cal-spacing-sm);
    --spacing-sm: var(--cal-spacing-lg);
    --spacing-md: 30px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;
    --spacing-2xl: 80px;

    /* ===== Shadows - Multi-niveaux ===== */
    --cal-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --cal-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --cal-shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);
    --cal-shadow-lg: 0 4px 20px rgba(79, 91, 213, 0.1);
    --cal-shadow-xl: 0 10px 40px rgba(79, 91, 213, 0.2);
    --cal-shadow-2xl: 0 20px 60px rgba(0, 0, 0, 0.3);

    /* Legacy shadow */
    --crowdaa-shadow: var(--cal-shadow-lg);

    /* ===== Border Radius ===== */
    --cal-radius-sm: 8px;
    --cal-radius-md: 12px;
    --cal-radius-lg: 16px;
    --cal-radius-xl: 24px;
    --cal-radius-full: 9999px;

    /* Legacy radius */
    --crowdaa-radius: var(--cal-radius-lg);

    /* ===== Transitions ===== */
    --cal-transition-fast: 0.15s ease;
    --cal-transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --cal-transition-slow: 0.5s ease;
    --cal-transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Legacy transition */
    --crowdaa-transition: var(--cal-transition-base);

    /* ===== Z-Index System ===== */
    --cal-z-base: 1;
    --cal-z-overlay: 10;
    --cal-z-dropdown: 1000;
    --cal-z-sticky: 5000;
    --cal-z-modal-overlay: 9999;
    --cal-z-modal: 10000;
    --cal-z-toast: 15000;

    /* ===== Breakpoints (pour référence JS) ===== */
    --cal-breakpoint-sm: 480px;
    --cal-breakpoint-md: 768px;
    --cal-breakpoint-lg: 1024px;
    --cal-breakpoint-xl: 1280px;
}

/* ========== WRAPPER PRINCIPAL ========== */
.crowdaa-advent-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    background: linear-gradient(180deg, #E8ECFF 0%, #FFFFFF 100%);
    border-radius: var(--crowdaa-radius);
    position: relative;
    overflow: hidden;
}

/* Effet de neige désactivé - géré par snowfall.js (v2.6.1) */

/* ========== EN-TÊTE ========== */
.crowdaa-advent-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.snowman-container {
    margin-bottom: 20px;
}

.snowman {
    font-size: 80px;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
    transform: translate3d(0, 0, 0); /* GPU acceleration */
    backface-visibility: hidden;
}

@keyframes bounce {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -20px, 0); }
}

.advent-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--crowdaa-dark-blue);
    margin: 0 0 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.advent-subtitle {
    font-size: 18px;
    color: var(--crowdaa-text-light);
    margin: 0;
}

/* ========== TABLEAU DE BORD UTILISATEUR ========== */
.crowdaa-user-dashboard {
    background: var(--crowdaa-white);
    border-radius: var(--crowdaa-radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--crowdaa-shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--cal-primary);
}

.user-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--crowdaa-dark-blue);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--crowdaa-light-blue);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--crowdaa-transition);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .stat-card:hover {
        transform: translate3d(0, -5px, 0);
        box-shadow: 0 8px 24px rgba(79, 91, 213, 0.15);
    }
}

/* Touch feedback for mobile */
.stat-card:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
    color: white;
}

.stat-icon {
    font-size: 36px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--crowdaa-dark-blue);
    line-height: 1;
}

.stat-card.highlight .stat-value {
    color: white;
}

.stat-label {
    font-size: 14px;
    color: var(--crowdaa-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* v3.8.3 - Streak card avec bonus */
.stat-card.streak-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 3px solid #f59e0b;
}

.stat-card.streak-card .stat-value {
    color: #d97706;
}

.stat-card.streak-card .stat-label {
    color: #92400e;
}

.stat-bonus {
    font-size: 13px;
    font-weight: 700;
    color: #7c2d12;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 8px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* v4.12.127 - Carte Streak Freeze */
.stat-card.freeze-card {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-left: 3px solid #0ea5e9;
}

.stat-card.freeze-card .stat-value {
    color: #0284c7;
}

.stat-card.freeze-card .stat-label {
    color: #075985;
}

.stat-card.freeze-card .freeze-icon {
    color: #0ea5e9;
}

/* v4.12.127 - Carte Best Streak (Record) */
.stat-card.best-streak-card {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-left: 3px solid #ec4899;
}

.stat-card.best-streak-card .stat-value {
    color: #db2777;
}

.stat-card.best-streak-card .stat-label {
    color: #9d174d;
}

.stat-card.best-streak-card .best-icon {
    color: #ec4899;
}

/* ================================================================
3. GRILLE DU CALENDRIER - Mobile-First
================================================================ */

/* Base: Mobile (<768px) - 2 colonnes */
.crowdaa-advent-calendar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--cal-spacing-sm);
    margin-bottom: var(--cal-spacing-2xl);
    padding: var(--cal-spacing-md);
}

/* Large Mobile (480px+) - 3 colonnes */
@media (min-width: 480px) {
    .crowdaa-advent-calendar {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--cal-spacing-md);
    }
}

/* Tablet (768px+) - 4 colonnes */
@media (min-width: 768px) {
    .crowdaa-advent-calendar {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--cal-spacing-lg);
        padding: var(--cal-spacing-lg);
    }
}

/* Desktop (1024px+) - Auto-fill flexible */
@media (min-width: 1024px) {
    .crowdaa-advent-calendar {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--cal-spacing-xl);
        padding: var(--cal-spacing-2xl);
    }

    .crowdaa-advent-calendar[data-columns="3"] {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .crowdaa-advent-calendar[data-columns="5"] {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

/* ========== CASE DU CALENDRIER (v2.7.0 - Améliorations UX) ========== */
    .advent-day {
        cursor: pointer;
        transition: var(--crowdaa-transition);
/* Animation d'apparition en cascade (v2.7.0) */
        opacity: 0;
        animation: fadeInUp 0.6s ease forwards;
    }

/* Délais d'animation par case pour effet cascade */
    .advent-day:nth-child(1) { animation-delay: 0.05s; }
    .advent-day:nth-child(2) { animation-delay: 0.1s; }
    .advent-day:nth-child(3) { animation-delay: 0.15s; }
    .advent-day:nth-child(4) { animation-delay: 0.2s; }
    .advent-day:nth-child(5) { animation-delay: 0.25s; }
    .advent-day:nth-child(6) { animation-delay: 0.3s; }
    .advent-day:nth-child(7) { animation-delay: 0.35s; }
    .advent-day:nth-child(8) { animation-delay: 0.4s; }
    .advent-day:nth-child(9) { animation-delay: 0.45s; }
    .advent-day:nth-child(10) { animation-delay: 0.5s; }
    .advent-day:nth-child(11) { animation-delay: 0.55s; }
    .advent-day:nth-child(12) { animation-delay: 0.6s; }
    .advent-day:nth-child(13) { animation-delay: 0.65s; }
    .advent-day:nth-child(14) { animation-delay: 0.7s; }
    .advent-day:nth-child(15) { animation-delay: 0.75s; }
    .advent-day:nth-child(16) { animation-delay: 0.8s; }
    .advent-day:nth-child(17) { animation-delay: 0.85s; }
    .advent-day:nth-child(18) { animation-delay: 0.9s; }
    .advent-day:nth-child(19) { animation-delay: 0.95s; }
    .advent-day:nth-child(20) { animation-delay: 1s; }
    .advent-day:nth-child(21) { animation-delay: 1.05s; }
    .advent-day:nth-child(22) { animation-delay: 1.1s; }
    .advent-day:nth-child(23) { animation-delay: 1.15s; }
    .advent-day:nth-child(24) { animation-delay: 1.2s; }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translate3d(0, 30px, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .advent-day:hover {
            transform: translate3d(0, -8px, 0);
        }
    }

/* Touch feedback for mobile */
    .advent-day:active {
        transform: scale(0.98);
        opacity: 0.95;
    }

/* ========== CASE "AUJOURD'HUI" (v2.7.0) ========== */
    .advent-day.is-today .day-card {
        border: 3px solid var(--cal-gold);
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0.1),
        0 8px 30px rgba(255, 215, 0, 0.3);
        animation: pulse-gold 2s ease-in-out infinite;
    }

    .advent-day.is-today .day-number {
        background: linear-gradient(135deg, var(--cal-gold) 0%, #FFA500 100%);
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
        animation: rotate-subtle 3s ease-in-out infinite;
    }

    @keyframes pulse-gold {
        0%, 100% {
            box-shadow: 0 0 0 8px rgba(255, 215, 0, 0.1),
            0 8px 30px rgba(255, 215, 0, 0.3);
        }
        50% {
            box-shadow: 0 0 0 12px rgba(255, 215, 0, 0.15),
            0 12px 40px rgba(255, 215, 0, 0.5);
        }
    }

    @keyframes rotate-subtle {
        0%, 100% { transform: rotate(0deg) scale(1) translate3d(0, 0, 0); }
        50% { transform: rotate(5deg) scale(1.05) translate3d(0, 0, 0); }
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .advent-day.is-today:hover {
            transform: translate3d(0, -12px, 0) scale(1.02);
        }
    }

/* Touch feedback for mobile */
    .advent-day.is-today:active {
        transform: scale(0.97);
    }

/* ========== CASE VERROUILLÉE (v2.7.0 - Shake au hover) ========== */
    .advent-day.locked {
        cursor: not-allowed;
        opacity: 0.7;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .advent-day.locked:hover {
            animation: gentle-shake 0.5s ease;
        }
    }

/* Touch feedback for mobile */
    .advent-day.locked:active {
        animation: gentle-shake 0.5s ease;
    }

    @keyframes gentle-shake {
        0%, 100% { transform: translate3d(0, 0, 0); }
        25% { transform: translate3d(-5px, 0, 0); }
        75% { transform: translate3d(5px, 0, 0); }
    }

    .day-card {
        background: var(--crowdaa-white);
        border-radius: var(--crowdaa-radius);
        overflow: hidden;
        box-shadow: var(--crowdaa-shadow);
        position: relative;
        height: 100%;
        min-height: 280px;
        display: flex;
        flex-direction: column;
    }

    .day-number {
        position: absolute;
        top: 15px;
        left: 15px;
        background: var(--cal-primary);
        color: white !important;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        font-weight: 700;
        z-index: 2;
        box-shadow: 0 4px 12px rgba(79, 91, 213, 0.3);
/* v4.7.23 - Opacité et couleur fixes pour éviter animation fadeInUp du parent */
        opacity: 1 !important;
    }

/* v4.7.23 - Spécifique pour cases rattrapage : aucune animation sur day-number */
    .advent-day.is-catchup .day-number {
        animation: none !important;
        opacity: 1 !important;
        color: white !important;
    }

    .completed-badge {
        position: absolute;
        top: 15px;
        right: 15px;
        background: var(--cal-success);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        z-index: 2;
        animation: pop-in 0.5s ease;
        transform: translate3d(0, 0, 0); /* GPU acceleration */
        backface-visibility: hidden;
    }

/* v4.7.0 - Badge score (8/10) pour quiz/trivia */
    .completed-badge.score-badge {
        width: auto;
        min-width: 50px;
        padding: 0 10px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 700;
        background: linear-gradient(135deg, #4F5BD5 0%, #667EEA 100%);
        box-shadow: 0 4px 12px rgba(79, 91, 213, 0.4);
    }

/* v3.8.0 - Badge rattrapage (v4.7.0 - Couleur positive orange au lieu de rouge) */
    .catchup-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: linear-gradient(135deg, #FF9500 0%, #FF8C00 100%); /* Orange positif au lieu de rouge */
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 700;
        z-index: 2;
        box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
        animation: pulse-catchup 2s ease-in-out infinite;
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    @keyframes pulse-catchup {
        0%, 100% {
            transform: translate3d(0, 0, 0) scale(1);
            box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
        }
        50% {
            transform: translate3d(0, -2px, 0) scale(1.05);
            box-shadow: 0 6px 16px rgba(255, 149, 0, 0.5);
        }
    }

/* Style pour les jours en rattrapage (v4.7.0 - Bordure orange au lieu de rouge) */
    .advent-day.is-catchup .day-card {
        border: 2px solid #FF9500;
        box-shadow: 0 4px 20px rgba(255, 149, 0, 0.15);
    }

    @keyframes pop-in {
        0% { transform: scale(0) translate3d(0, 0, 0); }
        50% { transform: scale(1.2) translate3d(0, 0, 0); }
        100% { transform: scale(1) translate3d(0, 0, 0); }
    }

/* ========== OVERLAY VERROUILLÉ (v2.7.0 - Amélioration visuelle) ========== */
    .locked-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(163, 174, 208, 0.9);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        z-index: 1;
        backdrop-filter: blur(5px);
        transition: background 0.3s ease;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .advent-day.locked:hover .locked-overlay {
            background: rgba(163, 174, 208, 0.95);
        }
    }

    .lock-icon {
        font-size: 48px;
        animation: swing 1.5s ease-in-out infinite;
    }

    @keyframes swing {
        0%, 100% { transform: rotate(0deg) translate3d(0, 0, 0); }
        25% { transform: rotate(-10deg) translate3d(0, 0, 0); }
        75% { transform: rotate(10deg) translate3d(0, 0, 0); }
    }

    .unlock-date {
        font-size: 14px;
        font-weight: 600;
        color: var(--crowdaa-dark-blue);
        background: rgba(255, 255, 255, 0.9);
        padding: 6px 12px;
        border-radius: 20px;
    }

/* ========== APERÇU DU CONTENU ========== */
    .day-content-preview {
        padding: 15px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .day-content-preview img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 15px;
    }

    .day-info {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .day-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--crowdaa-dark-blue);
        margin: 0 0 10px;
        line-height: 1.3;
    }

    .content-type-badge {
        display: inline-block;
        padding: 6px 12px;
        background: var(--crowdaa-light-blue);
        color: var(--cal-primary);
        font-size: 12px;
        font-weight: 600;
        border-radius: 20px;
        text-transform: uppercase;
        margin-bottom: 10px;
        align-self: flex-start;
    }

    .day-points {
        margin-top: auto;
        font-size: 16px;
        font-weight: 700;
        color: white;
        background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
        padding: 8px 16px;
        border-radius: 20px;
        box-shadow: 0 2px 8px rgba(126, 217, 87, 0.3);
        text-align: center;
        transition: var(--crowdaa-transition);
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .advent-day:hover .day-points {
            transform: scale(1.05) translate3d(0, 0, 0);
            box-shadow: 0 4px 12px rgba(126, 217, 87, 0.4);
        }
    }

/* ================================================================
    4. MODAL - Mobile-First avec Slide Animation
    ================================================================ */

/* Base: Mobile (<768px) - Plein écran avec slide depuis la droite */
    .crowdaa-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--cal-z-modal);
        background: rgba(0, 0, 0, 0.5);
    /* WebView optimizations */
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
    }

    .crowdaa-modal.active {
        display: block; /* Mobile: block */
    }

/* v4.3.11 - Desktop: flex pour centrage du modal */
    @media (min-width: 768px) {
        .crowdaa-modal.active {
            display: flex !important;
        }
    }

/* Overlay - Caché sur mobile pour effet fullscreen */
    .modal-overlay {
        display: none;
    }

/* Modal Content - Mobile fullscreen avec slide */
    .modal-content {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        background: white;
        border-radius: 0;
        overflow-y: auto;
        display: flex;
        flex-direction: column;

    /* Slide animation depuis la droite */
        transform: translateX(100%);
        transition: transform var(--cal-transition-base);

    /* Scrollbar caché mais scroll actif */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE et Edge */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .modal-content::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

/* Modal active - Slide in depuis la droite */
    .crowdaa-modal.active .modal-content {
        transform: translateX(0);
    }

/* Modal closing - Slide out vers la droite */
    .crowdaa-modal.closing .modal-content {
        transform: translateX(100%);
    }

/* Modal Close Button - Mobile */
    .modal-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.05);
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: var(--cal-text-muted);
        z-index: var(--cal-z-dropdown);
        width: 44px; /* iOS minimum touch target */
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--cal-radius-full);
        transition: all var(--cal-transition-fast);
        -webkit-tap-highlight-color: transparent;
    }

    .modal-close:active {
        background: rgba(0, 0, 0, 0.1);
        transform: scale(0.95);
    }

/* Modal Body - Mobile */
    .modal-body {
        padding: var(--cal-spacing-2xl) var(--cal-spacing-lg) var(--cal-spacing-lg);
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

/* Tablet (768px+) - Modal centré avec overlay */
    @media (min-width: 768px) {
        .crowdaa-modal {
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
        }

        .modal-overlay {
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(43, 54, 116, 0.8);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }

        .modal-content {
            position: relative;
            top: auto;
            right: auto;
            bottom: auto;
            left: auto;
            width: 90%;
            max-width: 700px;
            height: auto;
            max-height: 85vh;
            margin: 0;
            border-radius: var(--cal-radius-lg);
            box-shadow: var(--cal-shadow-2xl);
        /* Animation fade + scale au lieu de slide */
            transform: scale(0.95);
            opacity: 0;
            transition: transform var(--cal-transition-base), opacity var(--cal-transition-base);
        }

        .crowdaa-modal.active .modal-content {
            transform: scale(1);
            opacity: 1;
        }

        .crowdaa-modal.closing .modal-content {
            transform: scale(0.95);
            opacity: 0;
        }

        .modal-close:hover {
            background: rgba(0, 0, 0, 0.1);
            color: var(--cal-dark-blue);
        }

        .modal-body {
            padding: var(--cal-spacing-2xl);
        }
    }

/* Desktop (1024px+) - Modal plus grand */
    @media (min-width: 1024px) {
        .modal-content {
            max-width: 900px;
            max-height: 90vh;
        }
    }

/* ========== DAY HEADER (v3.8.7) ========== */
    .day-header {
        margin-bottom: 30px;
        text-align: center;
    }

    .day-number-square {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
        color: white;
        border-radius: 12px;
        font-size: 42px;
        font-weight: 800;
        margin-bottom: 20px;
        box-shadow: 0 6px 20px rgba(79, 91, 213, 0.4);
    }

    .day-header h2 {
        color: var(--crowdaa-dark-blue);
        font-size: 28px;
        margin: 0 0 15px 0;
        font-weight: 700;
        text-align: center;
    }

    .day-meta {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
    }

    .day-points {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        color: #92400e;
        padding: 6px 16px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 14px;
    }

/* v4.7.74 - Styles déplacés dans today-style.css (partagés avec .crowdaa-today-content) */
/* Voir today-style.css lignes 247-339 pour les styles complets */

/* Mode mobile - Header plus compact */
    @media (max-width: 768px) {
        .day-header h2 {
            font-size: 24px;
        }

        .day-number-square {
            width: 60px;
            height: 60px;
            font-size: 32px;
        }
    }

/* ========== LOADING SPINNER ========== */
    .loading-spinner {
        text-align: center;
        padding: 60px 20px;
    }

    .spinner {
        width: 50px;
        height: 50px;
        border: 4px solid var(--crowdaa-light-blue);
        border-top-color: var(--cal-primary);
        border-radius: 50%;
        margin: 0 auto 20px;
        animation: spin 1s linear infinite;
        transform: translate3d(0, 0, 0); /* GPU acceleration */
        backface-visibility: hidden;
    }

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

/* ========== CLASSEMENT ========== (v3.6.4 - Amélioration des couleurs) */
    .crowdaa-leaderboard-section {
        background: var(--crowdaa-white);
        border-radius: var(--crowdaa-radius);
        padding: 40px;
        box-shadow: var(--crowdaa-shadow);
    }

    .crowdaa-leaderboard-section h2 {
        text-align: center;
        color: var(--crowdaa-dark-blue);
        margin: 0 0 30px;
    }

    .leaderboard-container {
        min-height: 300px;
    }

    .crowdaa-leaderboard-item {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 20px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-radius: 12px;
        margin-bottom: 15px;
        transition: all 0.3s ease;
        border: 2px solid #e2e8f0;
        position: relative;
        overflow: hidden;
    }

    .crowdaa-leaderboard-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 5px;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

/* v4.12.90 - Désactiver hover sur mobile/tactile */
    @media (hover: hover) and (pointer: fine) {
        .crowdaa-leaderboard-item:hover {
            transform: translateX(10px) scale(1.02);
            box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
            border-color: #667eea;
        }

        .crowdaa-leaderboard-item:hover::before {
            opacity: 1;
        }
    }

/* v4.12.90 - Désactiver tous les effets sur touch devices */
    @media (hover: none), (pointer: coarse) {
        .crowdaa-leaderboard-item:hover,
        .crowdaa-leaderboard-item:active,
        .crowdaa-leaderboard-item:focus {
            transform: none !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        }

        .crowdaa-leaderboard-item:hover .points,
        .crowdaa-leaderboard-item:active .points,
        .crowdaa-leaderboard-item:focus .points {
            transform: none !important;
        }

        .crowdaa-leaderboard-item:hover .avatar,
        .crowdaa-leaderboard-item:active .avatar,
        .crowdaa-leaderboard-item:focus .avatar {
            transform: none !important;
        }
    }

/* Rang 1 - Or Premium */
    .crowdaa-leaderboard-item.rank-1 {
        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff9800 100%) !important;
        border: 2px solid #f59e0b !important;
        box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
        color: #78350f;
    }

    .crowdaa-leaderboard-item.rank-1::before {
        background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0.3 !important;
        width: 100%;
    }

    .crowdaa-leaderboard-item.rank-1 .rank {
        color: #78350f !important;
        text-shadow: 0 2px 8px rgba(255, 255, 255, 0.6);
    }

    .crowdaa-leaderboard-item.rank-1 .name {
        color: #78350f !important;
    }

    .crowdaa-leaderboard-item.rank-1 .avatar {
        border-color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .crowdaa-leaderboard-item.rank-1 .points {
        color: #78350f !important;
        background: rgba(120, 53, 15, 0.12) !important;
        border-color: rgba(120, 53, 15, 0.2) !important;
    }

/* Rang 2 - Argent Premium */
    .crowdaa-leaderboard-item.rank-2 {
        background: linear-gradient(135deg, #e8eaf6 0%, #cbd5e1 50%, #94a3b8 100%) !important;
        border: 2px solid #94a3b8 !important;
        box-shadow: 0 6px 24px rgba(148, 163, 184, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
        color: #1e293b;
    }

    .crowdaa-leaderboard-item.rank-2::before {
        background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0.4 !important;
        width: 100%;
    }

    .crowdaa-leaderboard-item.rank-2 .rank {
        color: #1e293b !important;
        text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
    }

    .crowdaa-leaderboard-item.rank-2 .name {
        color: #1e293b !important;
    }

    .crowdaa-leaderboard-item.rank-2 .avatar {
        border-color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .crowdaa-leaderboard-item.rank-2 .points {
        color: #1e293b !important;
        background: rgba(30, 41, 59, 0.12) !important;
        border-color: rgba(30, 41, 59, 0.2) !important;
    }

/* Rang 3 - Bronze Premium */
    .crowdaa-leaderboard-item.rank-3 {
        background: linear-gradient(135deg, #fed7aa 0%, #fb923c 50%, #c2410c 100%) !important;
        border: 2px solid #ea580c !important;
        box-shadow: 0 6px 24px rgba(234, 88, 12, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
        color: #431407;
    }

    .crowdaa-leaderboard-item.rank-3::before {
        background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0.3 !important;
        width: 100%;
    }

    .crowdaa-leaderboard-item.rank-3 .rank {
        color: #431407 !important;
        text-shadow: 0 1px 4px rgba(255, 255, 255, 0.4);
    }

    .crowdaa-leaderboard-item.rank-3 .name {
        color: #431407 !important;
    }

    .crowdaa-leaderboard-item.rank-3 .avatar {
        border-color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .crowdaa-leaderboard-item.rank-3 .points {
        color: #431407 !important;
        background: rgba(67, 20, 7, 0.12) !important;
        border-color: rgba(67, 20, 7, 0.2) !important;
    }

    .crowdaa-leaderboard-item .rank {
        font-size: 28px;
        font-weight: 800;
        min-width: 50px;
        text-align: center;
        color: #475569;
        position: relative;
        z-index: 1;
    }

    .crowdaa-leaderboard-item .avatar {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: 3px solid #e2e8f0;
        transition: all 0.3s ease;
        position: relative;
        z-index: 1;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .crowdaa-leaderboard-item:hover .avatar {
            transform: scale(1.1) rotate(5deg) translate3d(0, 0, 0);
            border-color: var(--cal-primary);
        }
    }

    .crowdaa-leaderboard-item.rank-1 .avatar,
    .crowdaa-leaderboard-item.rank-2 .avatar,
    .crowdaa-leaderboard-item.rank-3 .avatar {
        border-width: 4px;
    }

    .crowdaa-leaderboard-item .name {
        flex: 1;
        font-weight: 600;
        font-size: 16px;
        color: #1e293b;
        position: relative;
        z-index: 1;
    }

    .crowdaa-leaderboard-item .points {
        font-size: 22px;
        font-weight: 800;
        color: #667eea;
        padding: 8px 16px;
        background: rgba(102, 126, 234, 0.08);
        border-radius: 8px;
        border: 1px solid rgba(102, 126, 234, 0.15);
        transition: all 0.3s ease;
        position: relative;
        z-index: 1;
    }

/* v4.12.90 - Désactiver hover sur mobile/tactile */
    @media (hover: hover) and (pointer: fine) {
        .crowdaa-leaderboard-item:hover .points {
            background: rgba(102, 126, 234, 0.12);
            border-color: rgba(102, 126, 234, 0.3);
            transform: scale(1.05);
        }
    }

    .user-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-left: 6px;
        font-size: 11px;
        padding: 2px 6px;
        background: #10b981;
        color: white;
        border-radius: 8px;
        font-weight: 700;
    }

    .refresh-leaderboard {
        display: block;
        margin: 20px auto 0;
        padding: 14px 32px;
        background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-weight: 700;
        font-size: 15px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .refresh-leaderboard:hover {
            transform: translate3d(0, -3px, 0);
            box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
            background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
        }
    }

/* Touch feedback for mobile */
    .refresh-leaderboard:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

/* ========== QUIZ MULTI-STEPS ========== */
    .quiz-container, .blindtest-container, .rebus-container {
        padding: 20px 0;
    }

    .quiz-title {
        color: var(--crowdaa-dark-blue);
        margin-bottom: 15px;
    }

    .quiz-description {
        color: var(--crowdaa-text-light);
        margin-bottom: 30px;
    }

/* Indicateur de progression */
    .quiz-progress {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-bottom: 30px;
    }

    .progress-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #E8ECFF;
        transition: all 0.3s ease;
    }

    .progress-dot.active {
        background: var(--cal-primary);
        transform: scale(1.3);
    }

    .progress-dot.completed {
        background: var(--cal-secondary);
    }

    .quiz-counter {
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        color: var(--crowdaa-text-light);
        margin-bottom: 10px;
    }

/* Questions multi-steps */
    .quiz-question {
        background: var(--crowdaa-light-blue);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 25px;
        display: none; /* Caché par défaut */
        animation: slideIn 0.3s ease;
    }

    .quiz-question.active {
        display: block;
    }

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

    .quiz-question h3,
    .quiz-question h4 {
        color: var(--crowdaa-dark-blue);
        margin: 0 0 20px;
        font-size: 18px;
        line-height: 1.4;
    }

/* ========== BLIND TEST ========== */
    .blindtest-question {
        background: var(--crowdaa-light-blue);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 25px;
    }

    .audio-player {
        margin-bottom: 20px;
        text-align: center;
    }

    .audio-player audio {
        width: 100%;
        max-width: 500px;
        height: 40px;
        border-radius: 8px;
        outline: none;
    }

/* ========== RÉBUS ========== */
    .rebus-container {
        padding: 20px 0;
    }

    .rebus-image-wrapper {
        text-align: center;
        margin-bottom: 30px;
        background: var(--crowdaa-light-blue);
        padding: 30px;
        border-radius: 12px;
    }

    .rebus-image {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .rebus-question {
        background: var(--crowdaa-light-blue);
        padding: 25px;
        border-radius: 12px;
    }

    .rebus-hints {
        background: white;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
        border-left: 4px solid var(--crowdaa-warning);
    }

    .rebus-hints ul {
        list-style: none;
        text-align: left;
        padding: 0px;
    }

    .rebus-hints li {
        margin-bottom: 5px;
        color: var(--crowdaa-text);
    }

/* ========== OPTIONS QUIZ/BLIND TEST/RÉBUS ========== */

    .quiz-options {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .quiz-option {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: white;
        border-radius: 8px;
        cursor: pointer;
        transition: var(--crowdaa-transition);
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .quiz-option:hover {
            transform: translate3d(10px, 0, 0);
            box-shadow: 0 4px 12px rgba(79, 91, 213, 0.1);
        }
    }

/* Touch feedback for mobile */
    .quiz-option:active {
        transform: scale(0.98);
        background: #f8f9ff;
    }

    .quiz-option input[type="radio"],
    .quiz-option input[type="checkbox"] {
        margin-right: 12px;
        flex-shrink: 0; /* Empêche le bouton de rétrécir */
        display:none;
    }

/* v3.30.1 - Style radio buttons (taille fixe) */
    .quiz-option input[type="radio"] {
        appearance: none;
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        border: 2px solid var(--cal-primary);
        border-radius: 50%;
        outline: none;
        cursor: pointer;
        position: relative;
        transition: all 0.2s ease;
        background: white;
    }

    .quiz-option input[type="radio"]:checked {
        background: var(--cal-primary);
        border-color: var(--cal-primary);
    }

    .quiz-option input[type="radio"]:checked::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 8px;
        height: 8px;
        background: white;
        border-radius: 50%;
    }

/* v3.8.27 - Style checkbox comme radio (aspect rond) */
    .quiz-option input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        border: 2px solid var(--cal-primary);
        border-radius: 50%;
        outline: none;
        cursor: pointer;
        position: relative;
        transition: all 0.2s ease;
        display:none;
    }

    .quiz-option input[type="checkbox"]:checked {
        background: var(--cal-primary);
        border-color: var(--cal-primary);
    }

    .quiz-option input[type="checkbox"]:checked::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 8px;
        height: 8px;
        background: white;
        border-radius: 50%;
    }

/* Boutons de navigation multi-steps */
    .quiz-navigation {
        display: flex;
        gap: 15px;
        margin-top: 25px;
    }

    .quiz-nav-btn {
        flex: 1;
        padding: 15px;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: var(--crowdaa-transition);
    }

    .quiz-prev-btn {
        background: #E8ECFF;
        color: var(--cal-primary);
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .quiz-prev-btn:hover {
            background: #D0D8FF;
            transform: translate3d(0, -2px, 0);
        }
    }

/* Touch feedback for mobile */
    .quiz-prev-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    .quiz-next-btn {
        background: var(--cal-primary);
        color: white;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .quiz-next-btn:hover {
            background: var(--crowdaa-dark-blue);
            transform: translate3d(0, -2px, 0);
        }
    }

/* Touch feedback for mobile */
    .quiz-next-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    .quiz-next-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .submit-quiz-btn {
        width: 100%;
        padding: 15px;
        background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: var(--crowdaa-transition);
        box-shadow: 0 4px 12px rgba(79, 91, 213, 0.3);
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .submit-quiz-btn:hover {
            transform: translate3d(0, -2px, 0);
            box-shadow: 0 6px 16px rgba(79, 91, 213, 0.4);
        }
    }

/* Touch feedback for mobile */
    .submit-quiz-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

/* ========== VIDÉO RESPONSIVE ========== */
    .video-container {
        margin: 20px 0;
    }

    .video-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 56.25%; /* Ratio 16:9 */
        height: 0;
        overflow: hidden;
        border-radius: 12px;
        background: #000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .video-wrapper iframe,
    .video-wrapper video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 12px;
    }

    .video-wrapper video {
        background: #000;
    }

/* Player custom pour vidéo HTML5 */
    .video-wrapper video::-webkit-media-controls-panel {
        background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    }

/* ========== MESSAGE D'ERREUR ========== */
    .error-message {
        background: #FFE5E5;
        color: #D32F2F;
        padding: 20px;
        border-radius: 8px;
        border-left: 4px solid #D32F2F;
        margin: 20px 0;
        font-weight: 600;
    }

/* ========== CHALLENGE PHOTO - UI MODERNE ========== */

/* Wrapper principal pour l'upload */
    .photo-upload-wrapper {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin: 30px 0;
    }

/* Bouton upload style React */
    .photo-upload-button {
        position: relative;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
        border: 4px solid var(--crowdaa-white);
        box-shadow: 0 8px 30px rgba(79, 91, 213, 0.25),
        0 0 0 8px rgba(79, 91, 213, 0.1);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        transition: var(--crowdaa-transition);
        overflow: hidden;
    }

    .photo-upload-button::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
        );
        transform: rotate(45deg);
        transition: var(--crowdaa-transition);
        opacity: 0;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .photo-upload-button:hover::before {
            opacity: 1;
            animation: shimmer 1.5s ease-in-out infinite;
        }

        .photo-upload-button:hover {
            transform: scale(1.05) rotate(2deg) translate3d(0, 0, 0);
            box-shadow: 0 12px 40px rgba(79, 91, 213, 0.35),
            0 0 0 12px rgba(79, 91, 213, 0.15);
        }
    }

    @keyframes shimmer {
        0% { transform: translate3d(-100%, 0, 0) rotate(45deg); }
        100% { transform: translate3d(100%, 0, 0) rotate(45deg); }
    }

    .photo-upload-button:active {
        transform: scale(0.98);
    }

    .photo-upload-button .upload-icon {
        width: 48px;
        height: 48px;
        stroke: var(--crowdaa-white);
        z-index: 2;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }

    .photo-upload-button .upload-text {
        color: var(--crowdaa-white);
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        z-index: 2;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

/* Aperçu de la photo */
    .photo-upload-preview {
        position: relative;
        width: 100%;
        max-width: 400px;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes fadeInScale {
        from {
            opacity: 0;
            transform: scale(0.9) translate3d(0, 0, 0);
        }
        to {
            opacity: 1;
            transform: scale(1) translate3d(0, 0, 0);
        }
    }

    .photo-upload-preview .preview-image {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

/* v4.7.21 - RESTAURÉ avec :not() pour exclure challenge photo uniquement */
    .photo-upload-preview .remove-photo-btn:not(.challenge-cancel-btn) {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: var(--crowdaa-transition);
        z-index: 10;
    }

    @media (hover: hover) {
        .photo-upload-preview .remove-photo-btn:not(.challenge-cancel-btn):hover {
            background: var(--cal-danger);
            transform: scale(1.1) rotate(90deg) translate3d(0, 0, 0);
        }

        .photo-upload-preview .remove-photo-btn:not(.challenge-cancel-btn):hover svg {
            stroke: white;
        }
    }

    .photo-upload-preview .remove-photo-btn:not(.challenge-cancel-btn):active {
        transform: scale(0.95);
        background: var(--cal-danger);
    }

    .photo-upload-preview .remove-photo-btn:not(.challenge-cancel-btn):active svg {
        stroke: white;
    }

    .photo-upload-preview .remove-photo-btn:not(.challenge-cancel-btn) svg {
        stroke: #FF4757;
        transition: var(--crowdaa-transition);
    }

/* Bouton de soumission désactivé par défaut */
    .submit-challenge-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none !important;
    }

/* Section galerie */
    .challenge-gallery-section {
        margin-top: 30px;
        text-align: center;
    }

    .view-gallery-btn {
        background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
        color: var(--crowdaa-dark-blue);
        border: none;
        padding: 16px 32px;
        border-radius: 50px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(126, 217, 87, 0.3);
        transition: var(--crowdaa-transition);
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .view-gallery-btn:hover {
            transform: translate3d(0, -2px, 0);
            box-shadow: 0 6px 25px rgba(126, 217, 87, 0.4);
        }
    }

/* Touch feedback for mobile */
    .view-gallery-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    .view-gallery-btn .gallery-count {
        background: rgba(255, 255, 255, 0.3);
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 14px;
    }

/* Modal galerie - v3.30.66 - Slide-in panel au-dessus du catchup */
    .gallery-modal {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.95) !important;
        z-index: 100000 !important; /* Au-dessus du catchup modal (99999) */
        display: block !important; /* Toujours dans le DOM */
        visibility: hidden !important; /* Invisible par défaut */
        opacity: 0 !important;
        overflow-y: auto !important;
        padding: 80px 20px 40px 20px !important; /* Plus d'espace en haut pour le bouton retour */
        transform: translate3d(100%, 0, 0) !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s 0.4s !important; /* visibility delayed jusqu'à la fin */
        will-change: transform !important;
        backface-visibility: hidden !important;
        pointer-events: none !important; /* Pas de clic quand invisible */
    }

    .gallery-modal.active {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translate3d(0, 0, 0) !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s 0s !important; /* visibility immédiate à l'ouverture */
        pointer-events: auto !important; /* Réactiver les clics */
    }

    .gallery-header {
        text-align: center;
        margin-bottom: 40px;
        color: white;
    }

    .gallery-header h2 {
        font-size: 32px;
        margin-bottom: 10px;
    }

/* v3.30.61 - Bouton retour style moderne */
    .gallery-close {
        position: fixed;
        top: 20px;
        left: 20px; /* À gauche pour indiquer "retour" */
        height: 44px;
        padding: 0 20px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: white;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100001; /* Au-dessus de la galerie */
    }

    .gallery-close::before {
        content: '←';
        font-size: 20px;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .gallery-close:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateX(-4px);
        }
    }

/* Touch feedback for mobile */
    .gallery-close:active {
        background: rgba(255, 255, 255, 0.35);
        transform: scale(0.96);
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 30px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .gallery-item {
        background: var(--crowdaa-white);
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        transition: var(--crowdaa-transition);
        height: fit-content;
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .gallery-item:hover {
            transform: translate3d(0, -5px, 0);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
        }
    }

/* Touch feedback for mobile */
    .gallery-item:active {
        transform: scale(0.98);
        opacity: 0.95;
    }

    .gallery-item-image {
        width: 100%;
        height: 300px;
        object-fit: contain;
    }

    .gallery-item-footer {
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .gallery-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .gallery-user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--cal-primary), var(--cal-secondary));
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
    }

    .gallery-user-name {
        font-weight: 600;
        color: var(--crowdaa-dark-blue);
    }

    .gallery-like-btn {
        background: var(--crowdaa-light-blue);
        border: none;
        padding: 10px 20px;
        border-radius: 50px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: var(--crowdaa-transition);
        font-weight: 600;
        color: var(--cal-primary);
    }

/* Use @media hover for pointer devices only */
    @media (hover: hover) {
        .gallery-like-btn:hover {
            background: var(--cal-primary);
            color: white;
            transform: scale(1.05) translate3d(0, 0, 0);
        }

        .gallery-like-btn.liked:hover {
            transform: scale(1.05) translate3d(0, 0, 0);
        }
    }

/* Touch feedback for mobile */
    .gallery-like-btn:active {
        transform: scale(0.95);
        opacity: 0.9;
    }

    .gallery-like-btn.liked {
        background: linear-gradient(135deg, var(--cal-danger), #FF8E53);
        color: white;
    }

    .gallery-like-count {
        font-weight: 700;
    }

/* Empty state */
    .gallery-empty {
        text-align: center;
        padding: 60px 20px;
        color: rgba(255, 255, 255, 0.7);
    }

    .gallery-empty svg {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
        opacity: 0.3;
    }

/* Responsive pour galerie - v3.30.61 */
    @media (max-width: 768px) {
/* Gallery modal responsive */
        .gallery-modal {
            padding: 70px 15px 30px 15px;
        }

        .gallery-close {
            top: 15px;
            left: 15px;
            font-size: 14px;
            height: 40px;
            padding: 0 16px;
        }

        .gallery-header h2 {
            font-size: 24px;
        }

        .gallery-grid {
            grid-template-columns: 1fr;
            gap: 20px;
        }

        .photo-upload-button {
            width: 160px;
            height: 160px;
        }

        .photo-upload-button .upload-icon {
            width: 36px;
            height: 36px;
        }

        .photo-upload-button .upload-text {
            font-size: 14px;
        }
    }

/* ========== RESPONSIVE ========== */
    @media (max-width: 768px) {
        .advent-title {
            font-size: 32px;
        }

        .crowdaa-advent-calendar {
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
        }

        .day-card {
            min-height: 200px;
        }

/* .modal-content {
        width: 95%;
    } */

    .modal-body {
        padding: 20px;
    }

    .user-stats {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
Overlays pour Idées et Historique Roue (v1.5.0)
=================================================================== */

/* Overlay des Idées */
.ideas-modal,
.fortune-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    overflow-y: auto;
    padding: 40px 20px;
}

.ideas-modal.active,
.fortune-history-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.ideas-modal-header,
.fortune-history-modal-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.ideas-modal-header h2,
.fortune-history-modal-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.ideas-modal-close,
.fortune-history-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--crowdaa-transition);
    z-index: 10001;
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .ideas-modal-close:hover,
    .fortune-history-modal-close:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(90deg) translate3d(0, 0, 0);
    }
}

/* Touch feedback for mobile */
.ideas-modal-close:active,
.fortune-history-modal-close:active {
    background: rgba(255, 255, 255, 0.3);
    transform: none;
    transition: none;
}

.ideas-modal-content,
.fortune-history-modal-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Cartes d'idées dans l'overlay */
.idea-card {
    background: var(--crowdaa-white);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transition: var(--crowdaa-transition);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .idea-card:hover {
        transform: translate3d(0, -3px, 0);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    }
}

/* Touch feedback for mobile */
.idea-card:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.idea-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.idea-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.idea-meta {
    flex: 1;
}

.idea-meta strong {
    display: block;
    font-size: 16px;
    color: var(--crowdaa-dark);
}

.idea-date {
    font-size: 13px;
    color: #999;
}

.idea-card-body h4 {
    font-size: 20px;
    color: var(--crowdaa-dark);
    margin-bottom: 10px;
}

.idea-card-body p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.idea-card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.idea-votes {
    display: flex;
    gap: 15px;
    align-items: center;
}

.vote-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--crowdaa-transition);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .vote-btn:hover {
        border-color: var(--cal-primary);
        background: var(--cal-primary);
        color: white;
        transform: scale(1.05) translate3d(0, 0, 0);
    }

    .vote-btn.vote-up:hover {
        background: #4CAF50;
        border-color: #4CAF50;
    }

    .vote-btn.vote-down:hover {
        background: #f44336;
        border-color: #f44336;
    }
}

/* Touch feedback for mobile */
.vote-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.idea-votes.voted-up .vote-btn.vote-up {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.idea-votes.voted-down .vote-btn.vote-down {
    background: #f44336;
    border-color: #f44336;
    color: white;
}

/* Boutons pour ouvrir les overlays */
.view-ideas-btn,
.view-fortune-history-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--cal-primary), var(--cal-secondary));
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: var(--crowdaa-transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .view-ideas-btn:hover,
    .view-fortune-history-btn:hover {
        transform: translate3d(0, -2px, 0);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
}

/* Touch feedback for mobile */
.view-ideas-btn:active,
.view-fortune-history-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.ideas-count,
.history-count {
    opacity: 0.9;
    margin-left: 5px;
}

/* Historique dans l'overlay */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--crowdaa-white);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--crowdaa-transition);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .history-item:hover {
        transform: translate3d(5px, 0, 0);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
}

/* Touch feedback for mobile */
.history-item:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.history-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.history-user strong {
    display: block;
    font-size: 16px;
    color: var(--crowdaa-dark);
}

.history-time {
    font-size: 13px;
    color: #999;
}

.history-reward {
    font-size: 18px;
    font-weight: 600;
    color: var(--cal-primary);
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(var(--crowdaa-primary-rgb), 0.1), rgba(var(--crowdaa-secondary-rgb), 0.1));
    border-radius: 20px;
}

.no-ideas,
.no-history {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.no-ideas p,
.no-history p {
    font-size: 18px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .ideas-modal-header h2,
    .fortune-history-modal-header h2 {
        font-size: 24px;
    }

    .idea-card {
        padding: 20px;
    }

    .idea-votes {
        flex-direction: column;
        gap: 10px;
    }

    .vote-btn {
        width: 100%;
        justify-content: center;
    }

    .history-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .history-reward {
        width: 100%;
    }
}

/* ===================================================================
Overlay pour Mur des Témoignages (v1.5.0)
=================================================================== */

/* === TESTIMONIALS STYLES ===
* Tous les styles pour testimonials ont été déplacés vers testimonial.css
* pour éviter les conflits et duplications
*/

/* ===================================================================
Overlay pour Quiz Results (v3.0.8)
=================================================================== */

.quiz-results-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100001;
    align-items: center;
    justify-content: center;
}

/* Quand visible, utiliser flex pour centrer */
.quiz-results-overlay[style*="display: block"],
.quiz-results-overlay[style*="display: flex"] {
    display: flex !important;
}

.quiz-results-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: scale(1) translate3d(0, 0, 0);
    }
}

.quiz-results-content .results-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0) translate3d(0, 0, 0); }
    50% { transform: scale(1.2) translate3d(0, 0, 0); }
    100% { transform: scale(1) translate3d(0, 0, 0); }
}

.quiz-results-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--crowdaa-dark-blue);
    margin: 0 0 30px 0;
}

.score-banner {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    background: var(--crowdaa-light-blue);
    padding: 20px;
    border-radius: 12px;
    min-width: 120px;
    transition: var(--crowdaa-transition);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .score-item:hover {
        transform: translate3d(0, -5px, 0);
        box-shadow: 0 8px 20px rgba(79, 91, 213, 0.15);
    }
}

/* Touch feedback for mobile */
.score-item:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.score-label {
    font-size: 14px;
    color: var(--crowdaa-text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.score-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--cal-primary);
}

.quiz-results-content .message {
    font-size: 18px;
    color: #666;
    margin: 20px 0 30px 0;
    line-height: 1.6;
}

.quiz-close-btn {
    background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: var(--crowdaa-transition);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .quiz-close-btn:hover {
        transform: translate3d(0, -2px, 0);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
}

/* Touch feedback for mobile */
.quiz-close-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Responsive pour Quiz Results */
@media (max-width: 768px) {
    .quiz-results-content {
        padding: 40px 30px;
    }

    .quiz-results-content h2 {
        font-size: 26px;
    }

    .quiz-results-content .results-icon {
        font-size: 50px;
    }

    .score-banner {
        gap: 15px;
    }

    .score-value {
        font-size: 28px;
    }

    .quiz-results-content .message {
        font-size: 16px;
    }
}

/* ===================================================================
Quiz/Blind Test/Rébus Completed Results (v3.0.8)
Affichés quand l'utilisateur retourne sur une activité déjà complétée
=================================================================== */

.quiz-completed-results {
    padding: 20px 0;
}

.quiz-completed-results .results-header {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-completed-results .results-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.quiz-completed-results .results-header h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--crowdaa-dark-blue);
    margin: 0;
}

/* v4.12.144 - 3 colonnes comme demandé, fonts réduites */
.quiz-completed-results .results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 30px;
}

.quiz-completed-results .result-card {
    background: var(--crowdaa-light-blue);
    border-radius: 12px;
    padding: 15px 8px;
    text-align: center;
    transition: var(--crowdaa-transition);
}

/* Use @media hover for pointer devices only */
@media (hover: hover) {
    .quiz-completed-results .result-card:hover {
        transform: translate3d(0, -5px, 0);
        box-shadow: 0 8px 20px rgba(79, 91, 213, 0.15);
    }
}

/* Touch feedback for mobile */
.quiz-completed-results .result-card:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.quiz-completed-results .result-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.quiz-completed-results .result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--cal-primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.quiz-completed-results .result-label {
    font-size: 10px;
    color: var(--crowdaa-text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.quiz-completed-results .completion-message {
    text-align: center;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--cal-success);
}

.quiz-completed-results .completion-message p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.quiz-completed-results .completion-message strong {
    color: var(--crowdaa-dark-blue);
}

/* Responsive pour Quiz Completed Results */
@media (max-width: 768px) {
    .quiz-completed-results .results-icon {
        font-size: 50px;
    }

    .quiz-completed-results .results-header h3 {
        font-size: 24px;
    }

    .quiz-completed-results .results-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .quiz-completed-results .result-icon {
        font-size: 20px;
    }

    .quiz-completed-results .result-value {
        font-size: 16px;
    }

    .quiz-completed-results .result-label {
        font-size: 9px;
    }

    .quiz-completed-results .completion-message {
        padding: 15px;
    }

    .quiz-completed-results .completion-message p {
        font-size: 14px;
    }
}

/* ===================================================================
Challenge Photo Completed (v3.0.9)
Affichage de la photo soumise quand l'utilisateur retourne sur le challenge
=================================================================== */

.challenge-completed {
    padding: 20px 0;
}

.challenge-completed .completed-header {
    text-align: center;
    margin-bottom: 30px;
}

.challenge-completed .completed-icon {
    font-size: 30px;
    margin-bottom: 15px;
}

.challenge-completed .completed-header h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--crowdaa-dark-blue);
    margin: 0;
}

/* v4.9.7 - Style photo soumise - TOUS contextes (modal catchup + page normale) */
.submitted-photo-container,
.crowdaa-catchup-modal .submitted-photo-container,
.challenge-container .submitted-photo-container,
.day-content-full .submitted-photo-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 20px !important;
}

.submitted-photo,
.crowdaa-catchup-modal .submitted-photo,
.challenge-container .submitted-photo,
.day-content-full .submitted-photo {
    max-width: min(90%, 600px) !important;
    max-height: 500px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Legacy selector pour compatibilité */
.challenge-completed .submitted-photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.challenge-completed .submitted-photo {
    max-width: min(90%, 600px);
    max-height: 500px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    object-fit: contain;
    display: block;
}

.challenge-completed .completion-info {
    text-align: center;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--cal-success);
}

.challenge-completed .completion-info p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.challenge-completed .completion-info strong {
    color: var(--crowdaa-dark-blue);
}

/* Responsive pour Challenge Completed */
@media (max-width: 768px) {
    /* v4.9.9 - Responsive mobile - TOUTES propriétés (pas juste max-width/height!) */
    .submitted-photo-container,
    .crowdaa-catchup-modal .submitted-photo-container,
    .challenge-container .submitted-photo-container,
    .day-content-full .submitted-photo-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-bottom: 20px !important;
    }

    .submitted-photo,
    .crowdaa-catchup-modal .submitted-photo,
    .challenge-container .submitted-photo,
    .day-content-full .submitted-photo {
        max-width: min(95%, 400px) !important;
        max-height: 300px !important;
        width: auto !important;
        height: auto !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
    }

    .challenge-completed .completed-icon {
        font-size: 50px;
    }

    .challenge-completed .completed-header h3 {
        font-size: 24px;
    }

    .challenge-completed .submitted-photo {
        max-width: min(95%, 400px);
        max-height: 300px;
    }

    .challenge-completed .completion-info {
        padding: 15px;
    }

    .challenge-completed .completion-info p {
        font-size: 14px;
    }
}

/* ===================================================================
RESPONSIVE - ADDITIONAL BREAKPOINTS FOR WEBVIEW (v3.6.6)
=================================================================== */

/* Tablettes (landscape) */
@media (max-width: 1024px) {
    .advent-title {
        font-size: 40px;
    }

    .crowdaa-advent-calendar {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .modal-content {
        max-width: 90%;
    }
}

/* Mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Petits mobiles (iPhone SE, etc.) */
@media (max-width: 375px) {
    .advent-title {
        font-size: 28px;
    }

    .snowman {
        font-size: 60px;
    }

    .crowdaa-advent-calendar {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .day-card {
        min-height: 180px;
    }

    .modal-body {
        padding: 15px;
    }
}

/* ================================================================
TOUCH OPTIMIZATIONS & SAFE AREAS (v3.12.0)
================================================================ */

/* Touch-friendly interactions */
button,
.day-card,
.advent-day,
.stat-card,
.modal-close,
.clickable {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    cursor: pointer;
}

/* Minimum touch target size (44x44px iOS Human Interface Guidelines) */
button,
.day-card,
.advent-day {
    min-height: 44px;
    min-width: 44px;
}

/* iOS Safe Areas Support */
@supports (padding: max(0px)) {
    /* Header safe area */
    .crowdaa-advent-header {
        padding-top: max(var(--cal-spacing-lg), env(safe-area-inset-top));
    }

    /* Modal safe areas */
    .modal-content {
        padding-top: max(var(--cal-spacing-md), env(safe-area-inset-top));
        padding-bottom: max(var(--cal-spacing-md), env(safe-area-inset-bottom));
        padding-left: max(var(--cal-spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--cal-spacing-md), env(safe-area-inset-right));
    }

    /* Wrapper safe areas */
    .crowdaa-advent-wrapper {
        padding-left: max(var(--cal-spacing-lg), env(safe-area-inset-left));
        padding-right: max(var(--cal-spacing-lg), env(safe-area-inset-right));
    }
}

/* Smooth scrolling for all scrollable elements */
.modal-content,
.modal-body,
.crowdaa-advent-calendar {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Prevent text selection on interactive elements */
.day-card *,
.advent-day *,
button * {
    user-select: none;
    -webkit-user-select: none;
}

/* ================================================================
UTILITY CLASSES (v3.12.0)
================================================================ */

/* Visibility helpers */
.is-hidden {
    display: none !important;
}

.is-visible {
    display: block !important;
}

/* Locked overlay - Visible par défaut pour jours verrouillés */
.locked-overlay {
    display: flex;
}

/* Day content preview - Caché par défaut pour jours verrouillés */
.day-content-preview {
    display: none;
}

/* ================================================================
v3.10.1 - CONCLUSION BANNER
================================================================ */

/* Banner de conclusion (affiché après le dernier jour) */
.crowdaa-conclusion-banner {
    background: linear-gradient(135deg, var(--cal-primary) 0%, var(--cal-secondary) 100%);
    border-radius: var(--cal-border-radius-lg);
    padding: var(--cal-spacing-xl);
    margin: var(--cal-spacing-xl) 0;
    box-shadow: var(--cal-shadow-xl);
    color: var(--cal-white);
    animation: slideInUp 0.5s ease-out;
}

.conclusion-content {
    display: flex;
    align-items: center;
    gap: var(--cal-spacing-lg);
}

.conclusion-icon {
    font-size: var(--cal-font-size-4xl);
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

.conclusion-text {
    flex: 1;
}

.conclusion-text h3 {
    font-size: var(--cal-font-size-xl);
    font-weight: var(--cal-font-weight-bold);
    margin: 0 0 var(--cal-spacing-xs) 0;
    color: var(--cal-white);
}

.conclusion-text p {
    margin: 0;
    font-size: var(--cal-font-size-base);
    opacity: 0.95;
}

.conclusion-button {
    background: var(--cal-white);
    color: var(--cal-primary);
    border: none;
    padding: var(--cal-spacing-md) var(--cal-spacing-xl);
    border-radius: var(--cal-border-radius-lg);
    font-size: var(--cal-font-size-base);
    font-weight: var(--cal-font-weight-bold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.conclusion-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.conclusion-button:active {
    transform: translateY(0);
}

.conclusion-button.completed {
    background: rgba(255, 255, 255, 0.3);
    color: var(--cal-white);
    border: 2px solid var(--cal-white);
}

/* Responsive */
@media (max-width: 768px) {
    .crowdaa-conclusion-banner {
        padding: var(--cal-spacing-lg);
    }

    .conclusion-content {
        flex-direction: column;
        text-align: center;
        gap: var(--cal-spacing-md);
    }

    .conclusion-icon {
        font-size: var(--cal-font-size-3xl);
    }

    .conclusion-text h3 {
        font-size: var(--cal-font-size-lg);
    }

    .conclusion-button {
        width: 100%;
    }
}

/* Animation bounce pour l'icône */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation slide in */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ================================================================
v3.10.2 - CASE CONCLUSION (Jour de fin de calendrier)
================================================================ */

/* Style spécial pour la case de conclusion */
.advent-day.is-conclusion .day-card {
    background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%) !important;
    border: 3px solid #9C27B0;
    box-shadow: 0 0 0 8px rgba(156, 39, 176, 0.1),
    0 8px 32px rgba(156, 39, 176, 0.3);
}

/* Numéro de jour pour conclusion - v4.3.6 géré par PHP directement */
/* Le trophée 🏆 est maintenant affiché directement dans le HTML au lieu de CSS ::before */

/* Titre pour conclusion */
.advent-day.is-conclusion .day-title {
    color: #fff;
    font-weight: var(--cal-font-weight-bold);
}

/* Badge de type pour conclusion */
.advent-day.is-conclusion .content-type-badge {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: var(--cal-font-weight-semibold);
}

/* Points pour conclusion (0 points, on peut masquer) */
.advent-day.is-conclusion .day-points {
    display: none;
}

/* Overlay verrouillé pour conclusion */
.advent-day.is-conclusion .locked-overlay {
    background: rgba(156, 39, 176, 0.95);
}

/* Animation spéciale pour la conclusion quand elle se débloque */
.advent-day.is-conclusion.unlocked .day-card {
    animation: conclusionUnlock 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes conclusionUnlock {
    0% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Badge complété pour conclusion */
.advent-day.is-conclusion.completed .completed-badge {
    background: #9C27B0;
}

/* Hover effect pour conclusion */
.advent-day.is-conclusion.unlocked:hover .day-card {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 0 0 8px rgba(156, 39, 176, 0.15),
    0 12px 40px rgba(156, 39, 176, 0.4);
}

/* Mobile responsive - v4.3.6 plus besoin de ::before, géré en PHP */

}
