/* =====================================================
   XIXOU BUILDER V90 - CORRECTIONS & AMÉLIORATIONS
   Chargé APRÈS v88-fixes - toutes les règles ici gagnent
   ===================================================== */

/* =====================================================
   1. CROIX SUPPRESSION — TOUJOURS DANS LE CADRE DU SLOT
   
   v88 avait top: -6px / right: -6px = déborde.
   On la place DANS la case avec top/right positifs.
   ===================================================== */

.xb-remove {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    width: 18px !important;
    height: 18px !important;
    background: rgba(200, 30, 30, 0.9) !important;
    color: white !important;
    border-radius: 50% !important;
    border: none !important;
    display: none !important;
    z-index: 60 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 !important;
    text-align: center !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.6) !important;
}

.xb-slot.filled:hover .xb-remove {
    display: flex !important;
}

.xb-remove:hover {
    background: #ef4444 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6) !important;
}

/* Dofus inline — croix encore plus petite */
.xb-dofus-inline .xb-slot-dofus .xb-remove {
    top: 2px !important;
    right: 2px !important;
    width: 15px !important;
    height: 15px !important;
    font-size: 9px !important;
}

/* Slots en mode split (60px) — croix adaptée */
.xb-split-container.split-active .xb-remove {
    top: 2px !important;
    right: 2px !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 10px !important;
}


/* =====================================================
   2. ICÔNES STATS RÉDUITES DE 5%
   
   v88-fixes finale: 20px → on passe à 19px (-5%)
   ===================================================== */

.xb-sl-item img {
    width: 19px !important;
    height: 19px !important;
}

.xb-sl-item.xb-sl-compact img {
    width: 17px !important;
    height: 17px !important;
}

.xb-sl-icon-svg {
    width: 19px !important;
    height: 19px !important;
}

.xb-res-icon {
    width: 17px !important;
    height: 17px !important;
}


/* =====================================================
   3. SECTION DIVERS — JAMAIS TRONQUÉE
   ===================================================== */

.xb-all-stats {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

.xb-split-container.split-active .xb-col-doll .xb-all-stats {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    padding-bottom: 25px !important;
}

.xb-split-container.split-active .xb-col-doll {
    overflow-y: auto !important;
    max-height: none !important;
    height: auto !important;
}

.xb-stats-section:last-of-type {
    border-bottom: none !important;
    margin-bottom: 5px !important;
    padding-bottom: 15px !important;
}


/* =====================================================
   4. FILTRES MANQUANTS — STYLES BOUTONS
   ===================================================== */

.xb-filters-row.xb-filters-divers {
    margin-top: 4px !important;
    padding-top: 6px !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
}

.xb-split-filter-btn.xb-filter-res-per {
    border-color: rgba(147, 51, 234, 0.4) !important;
    color: #c4b5fd !important;
}

.xb-split-filter-btn.xb-filter-res-per.active {
    background: rgba(147, 51, 234, 0.3) !important;
    border-color: #9333ea !important;
    color: #e9d5ff !important;
}

.xb-split-filter-btn.xb-filter-divers {
    border-color: rgba(100, 116, 139, 0.4) !important;
    color: #94a3b8 !important;
}

.xb-split-filter-btn.xb-filter-divers.active {
    background: rgba(100, 116, 139, 0.3) !important;
    border-color: #64748b !important;
    color: #e2e8f0 !important;
}


/* =====================================================
   5. MODAL FM — TEXTES AGRANDIS
   
   Utilise #xb-fm-modal pour battre les règles v88
   ===================================================== */

#xb-fm-modal .xb-modal-box,
#xb-fm-modal.xb-modal-overlay .xb-modal-box {
    max-width: 850px !important;
    width: 95% !important;
    max-height: 92vh !important;
    background: linear-gradient(160deg, #1a1028 0%, #0f0f1a 40%, #0a0f15 100%) !important;
    border: 2px solid rgba(147, 51, 234, 0.5) !important;
    border-radius: 16px !important;
    box-shadow: 
        0 25px 80px rgba(0,0,0,0.85),
        0 0 60px rgba(147, 51, 234, 0.15),
        inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

#xb-fm-modal .xb-modal-header {
    padding: 16px 24px !important;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(245, 158, 11, 0.08)) !important;
    border-bottom: 2px solid rgba(147, 51, 234, 0.4) !important;
    border-radius: 14px 14px 0 0 !important;
}

#xb-fm-modal .xb-modal-header h3 {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #e9d5ff !important;
    text-shadow: 0 2px 12px rgba(147, 51, 234, 0.5) !important;
}

#xb-fm-modal .xb-modal-close {
    font-size: 1.6rem !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.08) !important;
}

#xb-fm-modal .xb-modal-close:hover {
    background: rgba(239, 68, 68, 0.3) !important;
}

#xb-fm-modal .xb-modal-body {
    padding: 24px !important;
    overflow-y: auto !important;
    max-height: 68vh !important;
}

#xb-fm-modal .xb-fm-section-title {
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    color: #f59e0b !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    margin-bottom: 8px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2) !important;
}

#xb-fm-modal .xb-fm-section-info {
    font-size: 1rem !important;
    color: #9ca3af !important;
    line-height: 1.6 !important;
    margin-bottom: 18px !important;
}

#xb-fm-modal .xb-fm-stat {
    padding: 10px 14px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-bottom: 5px !important;
    grid-template-columns: 1fr 70px 70px 50px !important;
    gap: 12px !important;
}

#xb-fm-modal .xb-fm-stat:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(212, 175, 55, 0.25) !important;
}

#xb-fm-modal .xb-fm-stat-name {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #e5e7eb !important;
}

#xb-fm-modal .xb-fm-stat-range {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    padding: 4px 8px !important;
}

#xb-fm-modal .xb-fm-input {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    width: 80px !important;
    height: 44px !important;
    text-align: center !important;
    background: rgba(0,0,0,0.5) !important;
    border: 2px solid rgba(255,255,255,0.15) !important;
    border-radius: 8px !important;
    color: #fff !important;
}

#xb-fm-modal .xb-fm-input:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3) !important;
    outline: none !important;
}

#xb-fm-modal .xb-fm-diff {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    min-width: 44px !important;
    text-align: center !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
}

#xb-fm-modal .xb-fm-diff.over {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

#xb-fm-modal .xb-fm-diff.under {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

#xb-fm-modal .xb-modal-footer {
    padding: 16px 24px !important;
    background: rgba(0,0,0,0.3) !important;
    border-top: 1px solid rgba(147, 51, 234, 0.2) !important;
    border-radius: 0 0 14px 14px !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
}

#xb-fm-modal .xb-modal-footer button {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: 12px 28px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
}

#xb-fm-modal .xb-btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: 2px solid #f59e0b !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

#xb-fm-modal .xb-btn-gold:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.6) !important;
}

#xb-fm-modal .xb-btn-secondary {
    background: rgba(255,255,255,0.06) !important;
    border: 2px solid rgba(255,255,255,0.2) !important;
    color: #d1d5db !important;
}


/* =====================================================
   6. EXOMAGIE — REFONTE VISUELLE COMPLÈTE
   ===================================================== */

#xb-fm-modal .xb-exo-section {
    margin-top: 28px !important;
    padding: 22px !important;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(79, 70, 229, 0.06)) !important;
    border: 2px solid rgba(147, 51, 234, 0.4) !important;
    border-radius: 14px !important;
    position: relative !important;
}

#xb-fm-modal .xb-exo-section::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, transparent 5%, #9333ea 30%, #7c3aed 70%, transparent 95%) !important;
    border-radius: 14px 14px 0 0 !important;
}

#xb-fm-modal .xb-exo-title {
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    color: #c084fc !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    margin-bottom: 14px !important;
    text-shadow: 0 2px 10px rgba(147, 51, 234, 0.4) !important;
}

#xb-fm-modal .xb-exo-info {
    font-size: 1rem !important;
    color: #c4b5fd !important;
    line-height: 1.7 !important;
    padding: 14px 18px !important;
    background: rgba(0,0,0,0.35) !important;
    border-radius: 10px !important;
    border-left: 4px solid #7c3aed !important;
    margin-bottom: 18px !important;
}

#xb-fm-modal .xb-exo-info strong {
    color: #e9d5ff !important;
    font-size: 1.05rem !important;
}

#xb-fm-modal .xb-exo-weight {
    font-size: 1.1rem !important;
    color: #d1d5db !important;
    margin-bottom: 18px !important;
    padding: 12px 16px !important;
    background: rgba(0,0,0,0.25) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(147, 51, 234, 0.2) !important;
}

#xb-fm-modal .xb-exo-weight strong {
    color: #f59e0b !important;
    font-size: 1.25rem !important;
}

#xb-fm-modal .xb-exo-group {
    margin-bottom: 18px !important;
}

#xb-fm-modal .xb-exo-group:last-child {
    margin-bottom: 0 !important;
}

#xb-fm-modal .xb-exo-group-label {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #a78bfa !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    margin-bottom: 12px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid rgba(147, 51, 234, 0.15) !important;
}

#xb-fm-modal .xb-exo-btns {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

#xb-fm-modal .xb-exo-btn {
    padding: 14px 26px !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    border: 2px solid rgba(147, 51, 234, 0.4) !important;
    background: rgba(147, 51, 234, 0.08) !important;
    color: #d1d5db !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    text-transform: uppercase !important;
    position: relative !important;
}

#xb-fm-modal .xb-exo-btn:hover {
    background: rgba(147, 51, 234, 0.2) !important;
    border-color: #9333ea !important;
    color: #e9d5ff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3) !important;
}

#xb-fm-modal .xb-exo-btn.active {
    background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
    border-color: #a855f7 !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.5), inset 0 1px 0 rgba(255,255,255,0.15) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

#xb-fm-modal .xb-exo-btn.active::after {
    content: '✓' !important;
    position: absolute !important;
    top: -7px !important;
    right: -7px !important;
    width: 20px !important;
    height: 20px !important;
    background: #22c55e !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: 900 !important;
    border: 2px solid #0f0f1a !important;
}

#xb-fm-modal .xb-exo-btn.xb-exo-btn-small {
    padding: 10px 18px !important;
    font-size: 1rem !important;
}


/* =====================================================
   7. HEADER SPLIT — PLUS COMPACT (sans réduire textes)
   ===================================================== */

.xb-split-ency-header {
    padding: 6px 14px !important;
    min-height: auto !important;
    gap: 8px !important;
}

.xb-split-ency-title {
    gap: 6px !important;
}

.xb-split-ency-icon {
    font-size: 1.1rem !important;
}

.xb-split-close-btn {
    padding: 5px 12px !important;
    font-size: 0.85rem !important;
}

.xb-split-current {
    padding: 4px 10px !important;
}

.xb-split-current-label {
    font-size: 0.65rem !important;
    margin-bottom: 2px !important;
}

.xb-split-current-item {
    padding: 4px 8px !important;
    gap: 8px !important;
    min-height: auto !important;
}

.xb-split-current-item img {
    width: 28px !important;
    height: 28px !important;
}

.xb-split-search-row {
    padding: 5px 10px !important;
    gap: 5px !important;
}

.xb-split-search-input {
    padding: 6px 10px !important;
}

.xb-split-sort-select {
    padding: 5px 8px !important;
    font-size: 0.8rem !important;
}

.xb-filters-toggle {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
}

.xb-filters-accordion {
    padding: 6px 10px !important;
}

.xb-filters-accordion .xb-filters-row {
    padding: 3px 0 !important;
}


/* =====================================================
   8. HOVER — BADGES GAINS/PERTES PLUS GRANDS
   ===================================================== */

.xb-sl-diff {
    position: absolute !important;
    top: -14px !important;
    right: -10px !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    padding: 5px 12px !important;
    border-radius: 8px !important;
    z-index: 100 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    line-height: 1.2 !important;
    min-width: 36px !important;
    text-align: center !important;
    animation: xb-diff-pop 0.25s ease-out !important;
}

.xb-sl-diff.positive {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: #fff !important;
    border: 2px solid #4ade80 !important;
    box-shadow: 0 3px 14px rgba(34, 197, 94, 0.7) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

.xb-sl-diff.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
    border: 2px solid #f87171 !important;
    box-shadow: 0 3px 14px rgba(239, 68, 68, 0.7) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}


/* =====================================================
   9. BADGE EXO SUR SLOT — DYNAMIQUE
   ===================================================== */

.xb-slot.exo {
    border: 2px dashed #a855f7 !important;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.5) !important;
    animation: exo-pulse-v90 2s ease-in-out infinite !important;
}

.xb-slot.exo::before {
    content: attr(data-exo-label) !important;
    position: absolute !important;
    top: -11px !important;
    right: -11px !important;
    background: linear-gradient(135deg, #9333ea, #7c3aed) !important;
    color: #fff !important;
    font-size: 0.55rem !important;
    font-weight: 900 !important;
    padding: 3px 5px !important;
    border-radius: 5px !important;
    z-index: 70 !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.5) !important;
    line-height: 1.2 !important;
}

.xb-slot.exo:not([data-exo-label])::before {
    content: 'EXO' !important;
}

.xb-slot.exo.forged::before {
    background: linear-gradient(135deg, #f59e0b, #9333ea) !important;
    font-size: 0.5rem !important;
}

.xb-slot.exo.forged:not([data-exo-label])::before {
    content: 'EXO+FM' !important;
}

.xb-slot.forged:not(.exo)::before {
    content: 'FM' !important;
    position: absolute !important;
    top: -9px !important;
    right: -9px !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    font-size: 0.55rem !important;
    font-weight: 900 !important;
    padding: 3px 5px !important;
    border-radius: 5px !important;
    z-index: 70 !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5) !important;
    line-height: 1.2 !important;
}

@keyframes exo-pulse-v90 {
    0%, 100% { box-shadow: 0 0 12px rgba(168, 85, 247, 0.5); }
    50% { box-shadow: 0 0 22px rgba(168, 85, 247, 0.8); }
}

.xb-slot.exo {
    animation-name: exo-pulse-v90 !important;
}
