/* ============================================
   COMPONENTS.CSS - Composants réutilisables
   Header, tabs, modals, boutons généraux
   ============================================ */

/* ----------------
   HEADER UTILISATEUR (Nouveau design)
   ---------------- */
.user-header {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-sm) 0;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-md);
}

.header-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}

.avatar-container {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    border: 3px solid transparent;
    background: linear-gradient(var(--background-card), var(--background-card)) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
    transition: all 0.3s ease;
    object-fit: cover;
}

.avatar-container:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4), 0 0 25px rgba(247, 147, 26, 0.3);
}

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

.user-name {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--text-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
}

.user-level {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.user-level span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Badges dans le header */
.header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(249, 115, 22, 0.2);
    color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.streak-label {
    color: var(--white);
    font-weight: 500;
}

.points-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(247, 147, 26, 0.2);
    color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .header-left {
        gap: 12px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }
    
    .user-name {
        font-size: 16px;
    }
    
    .user-level {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .header-badges {
        gap: 6px;
    }
    
    .streak-badge,
    .points-badge {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Ancien style (gardé pour compatibilité) */
.streak-display {
    display: none;
}

.header-right {
    display: none; /* Plus utilisé */
}

.streak-display .streak-text {
    color: white;
}

/* Header responsive */
@media (max-width: 480px) {
    .user-avatar {
        width: 100px;
        height: 100px;
    }
    
    .user-name {
        font-size: 18px;
    }
    
    .user-level {
        font-size: 12px;
    }
    
    .streak-display {
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* ----------------
   SUCCESS BOX
   ---------------- */
.success-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid var(--success-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.success-box h2 {
    color: #155724;
    margin-bottom: var(--spacing-sm);
}

.success-box p {
    color: #155724;
    margin-bottom: var(--spacing-xs);
}

.info-text {
    font-size: 14px;
    color: var(--gray-medium);
}

/* ----------------
   TEST SECTION
   ---------------- */
.test-section {
    background: var(--gray-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.test-result {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.test-result pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* ----------------
   TABS NAVIGATION
   ---------------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-light);
    justify-content: center;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-medium);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .tab-button {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.tab-button:hover {
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ----------------
   MODAL (Résultat)
   ---------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--background-card);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--gray-light);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--white);
}

.result-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-size: 28px;
}

.result-title.won {
    color: var(--success-color);
}

.result-title.lost {
    color: var(--error-color);
}

.result-details {
    margin-bottom: var(--spacing-md);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--gray-light);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
    color: var(--white);
}

.result-item.points-earned {
    background: var(--background);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--success-color);
}

.result-item.points-earned .result-value {
    color: var(--success-color);
    font-size: 20px;
}

/* ----------------
   RESULT MODAL V21 (Multi-crypto)
   ---------------- */
.result-title.mixed {
    color: var(--accent-color);
}

.result-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid var(--gray-medium);
}

.result-card.won {
    border-left-color: var(--success-color);
    background: rgba(8, 145, 178, 0.1);
}

.result-card.lost {
    border-left-color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.result-crypto {
    font-weight: 700;
    font-size: 16px;
    color: var(--accent-color);
}

.result-status {
    font-size: 14px;
    font-weight: 600;
}

.result-card.won .result-status {
    color: var(--success-color);
}

.result-card.lost .result-status {
    color: var(--error-color);
}

.result-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.result-direction {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-prices {
    font-size: 13px;
    color: var(--text-secondary);
}

.result-prices .positive {
    color: var(--success-color);
}

.result-prices .negative {
    color: var(--error-color);
}

.result-points {
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
    margin-top: var(--spacing-xs);
}

.result-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--accent-color), var(--bitcoin-orange));
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.result-total span:first-child {
    color: var(--white);
    font-weight: 500;
}

.total-points {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

/* History crypto badge */
.history-crypto {
    font-weight: 700;
    color: var(--accent-color);
    margin-right: var(--spacing-xs);
}

/* =====================================
   TOGGLE HISTORIQUE (V23.1)
   ===================================== */

.history-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: var(--spacing-md);
}

.history-toggle-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.history-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.history-toggle-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Historique groupé par jour */
.history-day {
    margin-bottom: var(--spacing-lg);
}

.history-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: var(--spacing-sm);
    padding-left: 5px;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item historique (paris + défis) */
.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-item .item-icon {
    font-size: 1.3rem;
    width: 35px;
    text-align: center;
}

.history-item .item-content {
    flex: 1;
}

.history-item .item-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crypto-svg-icon {
    display: inline-flex;
    vertical-align: middle;
}

.crypto-svg-icon svg {
    display: block;
}

.history-item .item-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.history-item .item-points {
    font-size: 0.95rem;
    font-weight: 700;
}

.history-item .item-points.positive {
    color: #22c55e;
}

.history-item .item-points.negative {
    color: #ef4444;
}

.history-item .item-points.neutral {
    color: rgba(255, 255, 255, 0.4);
}

/* Bordures colorées par type */
.history-item.btc {
    border-left: 3px solid var(--secondary-color);
}

.history-item.eth {
    border-left: 3px solid #627eea;
}

.history-item.spectre {
    border-left: 3px solid #8b5cf6;
}

.history-item.duel {
    border-left: 3px solid #00d4ff;
}

.history-item.soullink {
    border-left: 3px solid #a855f7;
}

.history-item.ghost {
    border-left: 3px solid var(--secondary-color);
}

/* ----------------
   LOADING & NO DATA
   ---------------- */
.loading-text {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-md);
}

.no-data {
    text-align: center;
    color: var(--gray-medium);
    padding: var(--spacing-xl);
    font-style: italic;
}

/* ----------------
   ANIMATIONS
   ---------------- */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 1s ease;
}

.level-up-animation {
    animation: pulse 1s ease 3;
    color: var(--success-color);
}

.button-pressed {
    transform: scale(0.95);
}

/* ----------------
   UTILITIES
   ---------------- */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }


/* ============================================
   RÈGLEMENT - ICÔNE ET MODAL
   ============================================ */

/* ----------------
   HEADER ACTIONS
   ---------------- */
.header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.btn-rules {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-rules:hover {
    background: var(--primary-color);
    color: var(--background-dark);
    transform: scale(1.1);
    box-shadow: var(--glow-primary);
}

/* ----------------
   MODAL RÈGLEMENT
   ---------------- */
.rules-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.rules-modal-content {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--spacing-lg);
    position: relative;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
}

.rules-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-modal-close:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

.rules-title {
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-light);
}

.rules-section {
    margin-bottom: var(--spacing-lg);
}

.rules-section h2 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rules-section h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.rules-section p {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: var(--spacing-xs);
}

.rules-section strong {
    color: var(--primary-color);
}

.rules-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: var(--spacing-xs);
}

.rules-levels {
    background: rgba(0, 212, 255, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.rules-levels p {
    margin: 0;
}

.rules-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-light);
    margin-top: var(--spacing-md);
}

.rules-footer p {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ----------------
   RESPONSIVE RÈGLEMENT
   ---------------- */
@media (max-width: 768px) {
    .rules-modal {
        padding: var(--spacing-sm);
    }
    
    .rules-modal-content {
        padding: var(--spacing-md);
        max-height: 85vh;
    }
    
    .rules-title {
        font-size: 1.4rem;
    }
    
    .rules-section h2 {
        font-size: 1.1rem;
    }
    
    .rules-section h3 {
        font-size: 1rem;
    }
    
    .btn-rules {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .header-actions {
        gap: var(--spacing-xs);
    }
}

/* ============================================
   BOTTOM NAV - Navigation fixe en bas
   ============================================ */
/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-card);
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Desktop : Style arcade clean */
@media (min-width: 768px) {
    .bottom-nav {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        max-width: 500px;
        background: #111827;
        border: 2px solid var(--primary-color);
        border-bottom: none;
        border-radius: 16px 16px 0 0;
        padding: 10px 16px;
        box-shadow: 
            0 -4px 30px rgba(0, 212, 255, 0.15),
            inset 0 2px 15px rgba(0, 212, 255, 0.05);
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    min-width: 60px;
    width: auto;
}

/* Desktop : Nav items */
@media (min-width: 768px) {
    .nav-item {
        padding: 10px 16px;
        border-radius: 12px;
        min-width: auto;
    }
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    transform: none;
    box-shadow: none;
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.15);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .nav-icon {
        font-size: 22px;
    }
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* Espace en bas du contenu pour la nav */
#mainContent {
    padding-bottom: 80px;
}

/* ============================================
   PARAMÈTRES - Onglet Settings
   ============================================ */
.settings-section {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--gray-light);
}

.settings-section h4 {
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--gray-light);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--gray-light);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    flex: 1;
}

.settings-item-label {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-item-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-light);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Settings Buttons */
.settings-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background-card);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-md);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-xs);
    text-align: left;
}

.settings-btn:last-child {
    margin-bottom: 0;
}

.settings-btn:hover {
    border-color: var(--primary-color);
    background: var(--background-card-hover);
    transform: translateX(4px);
    box-shadow: none;
}

.settings-btn-icon {
    font-size: 20px;
}

.settings-btn-text {
    flex: 1;
    font-weight: 500;
}

.settings-btn-danger {
    border-color: var(--error-color);
    color: var(--error-color);
}

.settings-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
}

.settings-btn-event {
    border-color: var(--secondary-color);
    background: rgba(247, 147, 26, 0.1);
}

.settings-btn-event:hover {
    background: rgba(247, 147, 26, 0.2);
    border-color: var(--secondary-color);
}

/* Responsive bottom nav */
@media (max-width: 480px) {
    .nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-label {
        font-size: 10px;
    }
}

/* ============================================
   MODAL SÉLECTEUR D'AVATAR
   ============================================ */
.avatar-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.avatar-modal.active {
    display: flex;
}

.avatar-modal-content {
    background: var(--background-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    max-width: 450px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--gray-light);
    animation: slideIn 0.3s ease;
}

.avatar-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.avatar-modal-close:hover {
    color: var(--white);
}

.avatar-modal-title {
    text-align: center;
    font-size: 22px;
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
}

.avatar-modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-md);
}

.section-label {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.current-avatar-section {
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

.current-avatar-display {
    display: inline-block;
}

.current-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid transparent;
    background: linear-gradient(var(--background-card), var(--background-card)) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
}

.avatar-default-section {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

.avatar-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: var(--spacing-sm);
    background: var(--background);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-option:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.avatar-option-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.avatar-option-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.avatar-levels-section {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

/* Section Avatar VIP */
.avatar-vip-section {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.1), rgba(0, 212, 255, 0.1));
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.avatar-vip-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: var(--spacing-sm);
    background: var(--background);
    border: 3px solid var(--secondary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 100px;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(247, 147, 26, 0.3);
}

.avatar-vip-option:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(247, 147, 26, 0.5);
}

.avatar-vip-option.selected {
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary), 0 0 20px rgba(247, 147, 26, 0.4);
}

.avatar-vip-option img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.avatar-vip-option .vip-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    text-align: center;
}

.avatar-levels-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar-level-option {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar-level-option:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.avatar-level-option.selected {
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.avatar-level-option.current {
    border-color: var(--secondary-color);
}

.avatar-level-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-badges-section {
    margin-bottom: var(--spacing-sm);
}

.avatar-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar-badge-option {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar-badge-option:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.avatar-badge-option.selected {
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.avatar-badge-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-badges-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--spacing-md);
}

/* Responsive avatar modal */
@media (max-width: 480px) {
    .avatar-level-option,
    .avatar-badge-option {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   MODAL ACCEPTATION CGU
   ============================================ */
.terms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.terms-modal.active {
    display: flex;
}

.terms-modal-content {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--gray-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin: auto;
}

.terms-modal-header {
    text-align: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.terms-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.terms-logo {
    width: 120px;
    height: 120px;
    display: block;
    margin: 0 auto var(--spacing-sm) auto;
}

.terms-modal-header h2 {
    color: var(--background-dark);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.terms-modal-body {
    padding: var(--spacing-lg);
}

.terms-intro {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-size: 14px;
}

.terms-points {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.terms-point {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--background);
    border-radius: var(--radius-md);
}

.terms-point-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.terms-point span:last-child {
    font-size: 14px;
    color: var(--text-color);
}

.terms-point strong {
    color: var(--primary-color);
}

.terms-links {
    text-align: center;
    margin-top: var(--spacing-md);
}

.terms-links a {
    color: var(--primary-color);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.terms-links a:hover {
    text-decoration: underline;
}

.terms-modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-light);
}

.terms-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
    margin-bottom: var(--spacing-md);
}

.terms-checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.terms-checkbox-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.terms-checkbox-text strong {
    color: var(--text-color);
}

.terms-accept-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background-dark);
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.terms-accept-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.terms-accept-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

/* ============================================
   BANNIÈRE CALENDRIER DE L'AVENT
   ============================================ */
.advent-banner {
    background: linear-gradient(135deg, #1e3a1e, #2d5a2d);
    border: 2px solid #4ade80;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
    animation: fadeInDown 0.3s ease;
}

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

.advent-banner-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.advent-banner-close:hover {
    color: #ef4444;
}

.advent-banner-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.advent-banner-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.advent-banner-text {
    flex: 1;
}

.advent-banner-title {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 4px;
}

.advent-banner-subtitle {
    font-size: 14px;
    color: #d1fae5;
}

.advent-banner-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #064e3b;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.advent-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

@media (max-width: 480px) {
    .advent-banner-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .advent-banner-btn {
        width: 100%;
    }
}

/* =====================================
   SECTION PARRAINAGE
   ===================================== */
.referral-section {
    padding: var(--spacing-sm) 0;
}

.referral-loading {
    color: var(--text-secondary);
    text-align: center;
    padding: var(--spacing-md);
}

.referral-error {
    color: var(--error-color);
    text-align: center;
    padding: var(--spacing-md);
}

/* Boîte du code */
.referral-code-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background-dark);
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.referral-code-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.referral-code-value {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Boutons */
.referral-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.referral-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.referral-btn-copy {
    background: var(--background-card);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.referral-btn-copy:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.referral-btn-share {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background-dark);
}

.referral-btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* Stats */
.referral-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: var(--spacing-md);
}

.referral-stats-icon {
    font-size: 18px;
}

.referral-stats-text {
    color: var(--success-color);
    font-weight: 600;
}

.referral-stats-points {
    color: var(--secondary-color);
    font-weight: 700;
}

/* Info */
.referral-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.referral-info strong {
    color: var(--secondary-color);
}

.referral-info-bonus {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Stats parrainage en 2 cases */
.referral-stats-grid {
    display: flex;
    gap: 12px;
    margin: 12px 0;
}

.referral-stat-card {
    flex: 1;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.referral-stat-card .referral-stat-value {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.referral-stat-card .referral-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

@media (max-width: 360px) {
    .referral-buttons {
        flex-direction: column;
    }
    
    .referral-code-value {
        font-size: 18px;
    }
}

/* =====================================
   MODAL PROFIL JOUEUR
   ===================================== */
.player-profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
}

.player-profile-modal.active {
    display: flex;
}

.player-profile-content {
    background: var(--background-card);
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--gray-light);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.2);
}

.player-profile-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.player-profile-close:hover {
    color: var(--text-color);
}

/* Header */
.player-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--gray-light);
}

.player-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid transparent;
    background: linear-gradient(var(--background-card), var(--background-card)) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
    object-fit: cover;
    margin-bottom: var(--spacing-sm);
}

.player-profile-info {
    text-align: center;
}

.player-profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.player-profile-level {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Sections */
.player-profile-section {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

.player-profile-section:last-child {
    border-bottom: none;
}

.player-profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-sm) 0;
}

/* Stats grid */
.player-profile-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.player-profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-profile-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.player-profile-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Rank */
.player-profile-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.player-profile-rank-value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-profile-rank-points {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Badges */
.player-profile-badges {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: var(--spacing-sm) 0;
}

.player-profile-badges-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--background-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.player-profile-badges-count .badge-icon {
    font-size: 18px;
}

/* =====================================
   PROFIL JOUEUR V2 - BOUTONS DÉFI
   ===================================== */
.profile-challenge-section {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-light);
}

.profile-challenge-buttons {
    display: flex;
    gap: 8px;
}

.profile-challenge-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--background);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-color);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.profile-challenge-btn .icon {
    font-size: 24px;
}

.profile-challenge-btn:hover:not(.disabled) {
    transform: translateY(-2px);
}

.profile-challenge-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Couleurs par type de défi */
.profile-challenge-btn.duel {
    border-color: var(--primary-color);
}
.profile-challenge-btn.duel:hover:not(.disabled) {
    background: rgba(0, 212, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.profile-challenge-btn.soullink {
    border-color: var(--rarity-epic);
}
.profile-challenge-btn.soullink:hover:not(.disabled) {
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.profile-challenge-btn.ghost {
    border-color: var(--secondary-color);
}
.profile-challenge-btn.ghost:hover:not(.disabled) {
    background: rgba(247, 147, 26, 0.15);
    box-shadow: 0 0 15px rgba(247, 147, 26, 0.3);
}

/* Tooltip pour boutons désactivés */
.profile-challenge-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-card);
    border: 1px solid var(--gray-light);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
    color: var(--text-secondary);
}

/* =====================================
   PROFIL JOUEUR V2 - STATS GRILLE 2x2
   ===================================== */
.player-profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.player-profile-stats-grid .player-profile-stat {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

/* =====================================
   PROFIL JOUEUR V2 - PALMARÈS
   ===================================== */
.player-profile-palmares {
    display: flex;
    gap: 12px;
}

.palmares-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 12px;
}

.palmares-icon {
    font-size: 24px;
}

.palmares-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
}

.palmares-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* =====================================
   PROFIL JOUEUR V2 - BADGE LE PLUS RARE
   ===================================== */
.player-profile-badge-showcase {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.badge-showcase-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.badge-showcase-info {
    flex: 1;
}

.badge-showcase-rarity {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.badge-showcase-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 2px;
}

/* Couleurs selon rareté */
.badge-showcase-name.legendary {
    color: var(--rarity-legendary);
}
.badge-showcase-name.epic {
    color: var(--rarity-epic);
}
.badge-showcase-name.rare {
    color: var(--rarity-rare);
}
.badge-showcase-name.common {
    color: var(--rarity-common);
}

/* =====================================
   BOUTON PARTAGE RÉSULTAT
   ===================================== */
.share-result-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: var(--spacing-md);
    padding: 14px 24px;
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.share-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
}

.share-result-btn:active {
    transform: translateY(0);
}

/* =====================================
   STATS MINI-CARDS (V21.8)
   ===================================== */

.stats-cards-section {
    margin-top: var(--spacing-lg);
}

.stats-cards-section h3 {
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.stats-mini-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: var(--spacing-lg);
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid var(--gray-light);
}

.mini-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.mini-card:hover {
    border-color: var(--gray-light);
}

.mini-card.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.mini-card.active.card-global {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.mini-card.active.card-btc {
    border-color: var(--secondary-color);
    background: rgba(247, 147, 26, 0.1);
}

.mini-card.active.card-eth {
    border-color: #627eea;
    background: rgba(98, 126, 234, 0.1);
}

.mini-card.active.card-race {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
}

.mini-card-icon {
    font-size: 18px;
    margin-bottom: 4px;
}

.mini-card-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
}

/* Glow effect sur les pourcentages - subtil */
.mini-card-value.glow {
    color: #00d4ff;
    text-shadow: 0 0 3px rgba(0, 212, 255, 0.5);
}

.mini-card.card-btc .mini-card-value.glow {
    color: var(--secondary-color);
    text-shadow: 0 0 3px rgba(247, 147, 26, 0.5);
}

.mini-card.card-eth .mini-card-value.glow {
    color: #627eea;
    text-shadow: 0 0 3px rgba(98, 126, 234, 0.5);
}

.mini-card.card-race .mini-card-value.glow {
    color: #0891b2;
    text-shadow: 0 0 3px rgba(8, 145, 178, 0.5);
}

.mini-card-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Stats Detail */
.stats-detail {
    margin-top: var(--spacing-md);
}

.stats-detail.btc .detail-value {
    color: var(--secondary-color);
}

.stats-detail.eth .detail-value {
    color: #627eea;
}

.stats-detail.race .detail-value {
    color: #0891b2;
}

.stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.detail-item {
    text-align: center;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.detail-value {
    font-size: 18px;
    font-weight: 700;
    color: #3b82f6;
}

.stats-detail.btc .detail-value {
    color: var(--secondary-color);
}

.stats-detail.eth .detail-value {
    color: #627eea;
}

.stats-detail.race .detail-value {
    color: #0891b2;
}

.detail-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
}

/* =====================================
   STATISTIQUES DÉFIS (V26 - simplifié)
   ===================================== */

.defis-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.defi-stat-box {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

.defi-stat-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.defi-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: auto;
}

.defi-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: auto;
}

.defi-stat-value .win-line,
.defi-stat-value .lose-line {
    display: flex;
    align-items: center;
    gap: 4px;
}

.defi-stat-value .label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.defi-stat-box.duel .defi-stat-value {
    color: #00d4ff;
}

.defi-stat-box.soullink .defi-stat-value {
    color: #a855f7;
}

.defi-stat-box.ghost .defi-stat-value {
    color: var(--secondary-color);
}

.defi-stat-value .win {
    color: #22c55e;
}

.defi-stat-value .lose {
    color: #ef4444;
}

/* Stats Spectre */
.spectre-stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

.defi-stat-box.spectre .defi-stat-value {
    color: #a78bfa;
}

/* =====================================
   ACCORDÉON PARAMÈTRES (V21.9)
   ===================================== */

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

.accordion-item {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-light);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: var(--background-light);
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-icon {
    font-size: 20px;
}

.accordion-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--white);
}

.accordion-arrow {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.open .accordion-content {
    max-height: 1000px;
}

.accordion-content-inner {
    padding: 16px;
    border-top: 1px solid var(--gray-light);
}

/* Notifications dans accordéon */
.notif-section {
    margin-top: 12px;
}

.notif-section:first-child {
    margin-top: 0;
}

.notif-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-top: 12px;
}

.notif-section:first-child .notif-section-title {
    padding-top: 0;
}

.notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

.notif-row:last-child {
    border-bottom: none;
}

.notif-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--white);
}

.notif-label-icon {
    font-size: 16px;
}

/* Toggle switch amélioré avec dégradé */
.toggle-switch-gradient {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--background-light);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch-gradient.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.toggle-switch-gradient::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch-gradient.active::after {
    transform: translateX(20px);
}

/* Account section dans accordéon */
.account-email {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.account-email-label {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-email-value {
    font-size: 15px;
    color: var(--white);
    word-break: break-all;
}

.account-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

/* Legal links dans accordéon */
.legal-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: background 0.2s ease;
}

.legal-link:hover {
    background: var(--background);
}

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

.legal-link-arrow {
    color: var(--text-secondary);
}

/* Paramètres footer */
.settings-footer-new {
    text-align: center;
    margin-top: 24px;
    padding-bottom: 20px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Push notification permission banner */
.push-permission-banner {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(247, 147, 26, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.push-permission-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.push-permission-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.push-permission-btn:hover {
    opacity: 0.9;
}

.push-disabled-notice {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

/* =====================================
   MODAL FULLSCREEN V2
   ===================================== */
.v2-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    z-index: 10000;
    overflow-y: auto;
}

.v2-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.v2-modal-content {
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-xl);
    text-align: center;
}

.v2-modal-header {
    margin-bottom: var(--spacing-lg);
}

.v2-modal-icon {
    font-size: 64px;
    display: block;
    margin-bottom: var(--spacing-md);
}

.v2-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    line-height: 1.3;
}

.v2-modal-thanks {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.v2-modal-features {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.v2-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.v2-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.v2-modal-list li {
    font-size: 15px;
    color: var(--white);
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

.v2-modal-list li:last-child {
    border-bottom: none;
}

.v2-modal-install {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(247, 147, 26, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.v2-modal-install-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.v2-modal-install-instructions {
    font-size: 13px;
    color: var(--text-secondary);
}

.v2-modal-install-instructions p {
    margin: 4px 0;
}

.v2-modal-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.v2-modal-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

@media (max-width: 480px) {
    .v2-modal-content {
        padding: var(--spacing-lg);
    }
    
    .v2-modal-icon {
        font-size: 48px;
    }
    
    .v2-modal-title {
        font-size: 20px;
    }
    
    .v2-modal-list li {
        font-size: 14px;
    }
}

/* ============================================
   LOTTERY EVENT STYLES
   ============================================ */

.lottery-container {
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Header Lottery */
.lottery-header {
    text-align: center;
    margin-bottom: 24px;
}

.lottery-hero-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
    border-radius: 16px;
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.05);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.lottery-header h2,
.lottery-header .lottery-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--white);
}

.lottery-countdown {
    font-size: 16px;
    color: var(--primary-color);
}

.lottery-countdown strong {
    font-weight: 700;
}

.lottery-ended {
    font-size: 18px;
    color: var(--success-color);
    font-weight: 600;
}

.lottery-description {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    margin-top: 16px;
    padding: 0 10px;
}

.lottery-description strong {
    color: var(--primary-color);
}

/* Sections Lottery */
.lottery-section {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.lottery-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    text-align: center;
    color: var(--white);
}

/* Tickets Grid */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.ticket-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.ticket-card.bronze {
    border-color: #cd7f32;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
}

.ticket-card.silver {
    border-color: #c0c0c0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.2);
}

.ticket-card.gold {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.ticket-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

.ticket-count {
    font-size: 32px;
    font-weight: 800;
    display: block;
    color: var(--white);
}

.ticket-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.ticket-value {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    display: block;
    margin-top: 4px;
}

.lottery-chances {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
}

.lottery-chances strong {
    color: var(--primary-color);
    font-size: 18px;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.leaderboard-row.current-user {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-color);
}

.lb-rank {
    width: 30px;
    font-weight: 600;
    color: var(--text-secondary);
}

.lb-name {
    flex: 1;
    font-weight: 500;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-parts {
    font-weight: 600;
    color: var(--primary-color);
}

.lb-parts small {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.leaderboard-stats {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.leaderboard-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.leaderboard-empty p:first-child {
    margin-bottom: 8px;
}

.leaderboard-separator {
    text-align: center;
    color: var(--text-secondary);
    padding: 8px 0;
    font-size: 14px;
    letter-spacing: 4px;
}

/* Rules List */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.rule-action {
    flex: 1;
    font-size: 14px;
    color: var(--white);
}

.rule-ticket {
    font-size: 20px;
    margin: 0 12px;
}

.rule-limit {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 90px;
    text-align: right;
}

/* Prizes List */
.prizes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prizes-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 10px;
}

.prize-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.prize-item.rank-1 {
    border: 1px solid #ffd700;
    background: rgba(255, 215, 0, 0.05);
}

.prize-item.rank-2 {
    border: 1px solid #c0c0c0;
}

.prize-item.rank-3 {
    border: 1px solid #cd7f32;
}

.prize-rank {
    font-size: 24px;
    margin-right: 12px;
}

.prize-detail {
    font-size: 14px;
    color: var(--white);
}

/* Participation Badge Section */
.participation-badge-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.participation-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.participation-desc strong {
    color: var(--primary-color);
}

.participation-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.participation-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.participation-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--rarity-rare));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.participation-fill.complete {
    background: linear-gradient(90deg, var(--success-color), #4ade80);
}

.participation-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Section header avec badge */
.lottery-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lottery-section-header h3 {
    margin-bottom: 0;
}

.lottery-parts-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Rules collapsible */
.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    transition: opacity 0.2s ease;
}

.rules-header:hover {
    opacity: 0.8;
}

.rules-header h3 {
    margin-bottom: 0;
}

.rules-toggle-icon {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.rules-content {
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

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

/* No Event Message */
.no-event-message {
    text-align: center;
    padding: 60px 20px;
}

.no-event-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.no-event-message h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--white);
}

.no-event-message p {
    color: var(--text-secondary);
}

/* Responsive Lottery */
@media (max-width: 400px) {
    .ticket-card {
        padding: 12px 4px;
    }
    
    .ticket-count {
        font-size: 26px;
    }
    
    .ticket-icon {
        font-size: 24px;
    }
    
    .rule-action {
        font-size: 13px;
    }
    
    .rule-limit {
        min-width: 70px;
        font-size: 11px;
    }
}

/* ============================================
   SYSTÈME DE DÉFIS
   ============================================ */

/* Toggle principal Classement / Défis */
.leaderboard-main-toggle {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    background: var(--background);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-light);
}

.main-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.main-toggle-btn:hover:not(.active) {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
}

.main-toggle-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--background);
}

/* Petit toggle Ce mois / All-time */
.leaderboard-filter-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.leaderboard-filter-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 3px;
}

.leaderboard-filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    white-space: nowrap;
}

.leaderboard-filter-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.leaderboard-filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
}

/* Badge notification sur le toggle */
.notif-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    background: var(--error-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Vue des défis */
#defisView {
    width: 100%;
    overflow: hidden;
}

/* Sections des défis */
.defis-section {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.defis-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

/* Stats des défis (3 cartes) */
.defis-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    width: 100%;
}

.defi-stat-card {
    min-width: 0;
    overflow: hidden;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.defi-stat-card .defi-stat-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.defi-stat-card:hover {
    transform: translateY(-2px);
}

/* Couleurs des bordures par type */
.defi-stat-card.defi-duel {
    border-color: var(--primary-color);
}

.defi-stat-card.defi-soullink {
    border-color: var(--rarity-epic);
}

.defi-stat-card.defi-ghost {
    border-color: var(--secondary-color);
}

.defi-stat-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.defi-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.defi-stat-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
}

.defi-stat-value.zero {
    color: var(--text-secondary);
}

/* Label des cartes défis */
.defi-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Carte grisée quand épuisée */
.defi-stat-card.used {
    opacity: 0.5;
    border-color: var(--gray-light) !important;
}

.defi-stat-card.used:hover {
    transform: none;
}

/* Invitations */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.invitation-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-left: 3px solid var(--primary-color);
}

.invitation-card.invitation-duel {
    border-left-color: var(--primary-color);
}

.invitation-card.invitation-soullink {
    border-left-color: var(--rarity-epic);
}

.invitation-card.invitation-ghost {
    border-left-color: var(--secondary-color);
}

.invitation-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.invitation-icon {
    font-size: 20px;
}

.invitation-text {
    flex: 1;
    font-size: 14px;
}

.invitation-name {
    color: var(--primary-color);
    font-weight: 600;
}

.invitation-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.invitation-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invitation-btn-accept {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: var(--white);
}

.invitation-btn-accept:hover {
    transform: scale(1.02);
}

.invitation-btn-refuse {
    background: var(--gray-light);
    color: var(--text-secondary);
}

.invitation-btn-refuse:hover {
    background: var(--background-card-hover);
}

/* Défis actifs */
.active-defis-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.active-defi-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border-left: 3px solid var(--primary-color);
}

.active-defi-card.defi-duel {
    border-left-color: var(--primary-color);
}

.active-defi-card.defi-soullink {
    border-left-color: var(--rarity-epic);
}

.active-defi-card.defi-ghost {
    border-left-color: var(--secondary-color);
}

.active-defi-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.active-defi-icon {
    font-size: 20px;
}

.active-defi-title {
    font-weight: 600;
    color: var(--white);
}

.active-defi-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.active-defi-status .waiting {
    color: var(--warning-color);
}

.active-defi-status .ready {
    color: var(--success-color);
}

/* Boutons d'action pour lancer un défi */
.defis-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.defi-action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.defi-action-btn:hover:not(.disabled) {
    transform: translateX(4px);
}

.defi-action-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Couleurs des boutons par type */
.defi-action-btn.defi-action-duel {
    border-color: var(--primary-color);
}

.defi-action-btn.defi-action-duel:hover:not(.disabled) {
    background: rgba(0, 212, 255, 0.1);
}

.defi-action-btn.defi-action-soullink {
    border-color: var(--rarity-epic);
}

.defi-action-btn.defi-action-soullink:hover:not(.disabled) {
    background: rgba(139, 92, 246, 0.1);
}

.defi-action-btn.defi-action-ghost {
    border-color: var(--secondary-color);
}

.defi-action-btn.defi-action-ghost:hover:not(.disabled) {
    background: rgba(247, 147, 26, 0.1);
}

.defi-action-icon {
    font-size: 20px;
}

.defi-action-text {
    flex: 1;
    text-align: left;
}

.defi-action-arrow {
    color: var(--text-secondary);
    font-size: 20px;
}

/* Message pas de défis */
.no-defis-message {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.no-defis-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
}

.no-defis-hint {
    font-size: 13px;
    margin-top: var(--spacing-xs);
}

/* ============================================
   MODALES DÉFIS
   ============================================ */

.challenge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.challenge-modal.active {
    display: flex;
}

.challenge-modal-content {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--gray-light);
    animation: modalSlideIn 0.3s ease;
}

.challenge-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

.challenge-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.challenge-modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.challenge-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.challenge-modal-body {
    padding: var(--spacing-md);
}

/* Recherche de joueur */
.player-search-input-wrapper {
    margin-bottom: var(--spacing-md);
}

.player-search-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--background);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.player-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.player-search-input::placeholder {
    color: var(--text-secondary);
}

.player-search-results {
    max-height: 300px;
    overflow-y: auto;
}

.search-hint {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-md);
}

.player-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
}

.player-result-item:hover {
    background: var(--background);
}

.player-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.player-result-info {
    flex: 1;
}

.player-result-name {
    font-weight: 600;
    color: var(--white);
}

.player-result-level {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Règles modal */
.challenge-rules-content {
    max-width: 380px;
}

.rules-icon-big {
    text-align: center;
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
}

.rules-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.rules-section-block {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.rules-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.rules-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

.rules-row:last-child {
    border-bottom: none;
}

.rules-row .label {
    color: var(--text-secondary);
    font-size: 13px;
}

.rules-row .value {
    font-weight: 600;
    font-size: 13px;
    color: var(--white);
    text-align: right;
}

.rules-row .value.green {
    color: var(--success-color);
}

.rules-row .value.red {
    color: var(--error-color);
}

.rules-row .value.orange {
    color: var(--warning-color);
}

.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: var(--spacing-xs);
}

.rules-table th {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}

.rules-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.rules-table tr:last-child td {
    border-bottom: none;
}

.rules-table td.green {
    color: var(--success-color);
}

.rules-table td.red {
    color: var(--error-color);
}

.rules-table td.orange {
    color: var(--warning-color);
}

.rules-note {
    text-align: center;
    font-size: 13px;
    color: var(--primary-color);
    margin-top: var(--spacing-md);
    font-style: italic;
}

/* Confirmation modal */
.confirm-icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
}

.confirm-text {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--spacing-xs);
}

.confirm-desc {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.confirm-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.confirm-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-btn-cancel {
    background: var(--gray-light);
    color: var(--text-secondary);
}

.confirm-btn-cancel:hover {
    background: var(--background-card-hover);
}

.confirm-btn-confirm {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.confirm-btn-confirm:hover {
    transform: scale(1.02);
}

/* Ghost choice modal */
.ghost-choice-intro {
    text-align: center;
    font-size: 16px;
    color: var(--white);
    margin-bottom: var(--spacing-md);
}

.ghost-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ghost-choice-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ghost-choice-btn:hover {
    transform: scale(1.02);
}

.ghost-choice-btn.ghost-choice-win:hover {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.ghost-choice-btn.ghost-choice-lose:hover {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.ghost-choice-icon {
    font-size: 24px;
}

.ghost-choice-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

/* Responsive */
@media (max-width: 480px) {
    .defis-stats-row {
        gap: var(--spacing-xs);
    }
    
    .defi-stat-card {
        padding: var(--spacing-xs);
    }
    
    .defi-stat-icon {
        font-size: 20px;
    }
    
    .defi-stat-label {
        font-size: 10px;
    }
    
    .defi-stat-value {
        font-size: 12px;
    }
    
    .defi-action-btn {
        padding: var(--spacing-sm);
    }
    
    .challenge-modal-content {
        width: 95%;
        max-height: 85vh;
    }
}

/* ----------------
   SETTINGS HEADER (avec toggle son)
   ---------------- */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.settings-header h3 {
    margin: 0;
}

.sound-toggle-btn {
    background: var(--background-card);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle-btn:hover {
    border-color: var(--primary-color);
    background: var(--background-card-hover);
}

.sound-toggle-btn.active {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

/* ============================================
   ONBOARDING - Slides de bienvenue
   ============================================ */

/* Overlay */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    display: none;
}

.onboarding-overlay.active {
    display: flex;
}

/* Container principal */
.onboarding-container {
    width: 100%;
    max-width: 400px;
    background: var(--background-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-light);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Slide */
.onboarding-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 40px 30px;
    text-align: center;
    min-height: 480px;
}

.onboarding-slide.active {
    display: flex;
}

/* Emoji géant */
.slide-emoji {
    font-size: 80px;
    margin-bottom: 24px;
    animation: onboarding-float 3s ease-in-out infinite;
}

@keyframes onboarding-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Titre */
.slide-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.slide-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 320px;
}

.slide-description strong {
    color: var(--primary-color);
}

.slide-description .highlight-orange {
    color: var(--secondary-color);
}

/* Instructions PWA */
.pwa-instructions {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 8px;
    text-align: left;
    width: 100%;
}

.pwa-instructions-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.pwa-step {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.pwa-step-number {
    background: var(--primary-color);
    color: var(--background);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Footer avec navigation */
.onboarding-footer {
    padding: 20px 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Dots de pagination */
.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-light);
    transition: all 0.3s ease;
}

.onboarding-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary-color);
}

/* Bouton suivant */
.onboarding-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.onboarding-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--background);
    box-shadow: var(--glow-primary);
}

.onboarding-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.onboarding-btn-final {
    background: linear-gradient(135deg, var(--secondary-color), #e67e00);
    color: var(--white);
    box-shadow: var(--glow-secondary);
}

.onboarding-btn-final:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(247, 147, 26, 0.6);
}

/* Badges défis */
.challenge-badges {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.challenge-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.challenge-badge-icon {
    font-size: 32px;
}

.challenge-badge-name {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-height: 600px) {
    .onboarding-slide {
        min-height: 400px;
        padding: 30px 24px;
    }
    .slide-emoji {
        font-size: 60px;
        margin-bottom: 16px;
    }
    .slide-title {
        font-size: 20px;
    }
    .slide-description {
        font-size: 14px;
    }
}
