.hench-banner { background: linear-gradient(135deg, var(--banner-color, #5E72AF), var(--banner-color-alpha, #5E72AFcc)); padding: 1rem 1.5rem; color: white; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; border-radius: 10px; }
.hench-banner-left { display: flex; align-items: center; gap: 0.75rem; }
.hench-banner-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.hench-banner-icon img { width: 26px; height: 26px; }
.hench-banner h1 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.hench-banner-stats { display: flex; gap: 1.5rem; }
.hench-banner-stat { text-align: center; }
.hench-banner-stat-value { font-size: 1.25rem; font-weight: 700; }
.hench-banner-stat-label { font-size: 0.7rem; opacity: 0.8; }

.hench-filters { background: var(--wiki-bg-card); border: 1px solid var(--wiki-border); border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.hench-search { position: relative; flex: 1; min-width: 150px; max-width: 220px; }
.hench-search input { width: 100%; padding: 6px 10px 6px 32px; border: 1px solid var(--wiki-border); border-radius: 6px; font-size: 0.85rem; background: var(--wiki-bg-tertiary); color: var(--wiki-text-primary); }
.hench-search input::placeholder { color: var(--wiki-text-muted); }
.hench-search input:focus { outline: none; border-color: var(--wiki-accent); }
.hench-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--wiki-text-muted); font-size: 0.8rem; }
.hench-search .search-loader { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; color: var(--wiki-accent); }
.hench-search.loading .search-loader { display: block; }

.race-filters { display: flex; gap: 3px; flex-wrap: wrap; }
.race-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--wiki-border); background: var(--wiki-bg-card); cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 3px; }
.race-btn img { width: 20px; height: 20px; opacity: 0.6; }
.race-btn:hover img { opacity: 1; }
.race-btn.all-btn { padding: 0 10px; width: auto; }
.race-btn.all-btn span { font-size: 0.75rem; font-weight: 500; color: var(--wiki-text-secondary); }
.race-btn.all-btn.active span { color: white; }
.race-btn.active { border-color: transparent; }
.race-btn.active img { opacity: 1; }
.race-btn[data-race="-1"].active { background: #5E72AF; }
.race-btn[data-race="0"].active { background: #e74c3c; }
.race-btn[data-race="1"].active { background: #9b59b6; }
.race-btn[data-race="2"].active { background: #e67e22; }
.race-btn[data-race="3"].active { background: #3498db; }
.race-btn[data-race="4"].active { background: #f06292; }
.race-btn[data-race="5"].active { background: #27ae60; }
.race-btn[data-race="6"].active { background: #f39c12; }
.race-btn[data-race="7"].active { background: #7f8c8d; }

.acq-filters { display: flex; gap: 3px; flex-wrap: wrap; }
.acq-btn { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--wiki-border); background: var(--wiki-bg-card); color: var(--wiki-text-secondary); font-size: 0.75rem; font-weight: 500; display: flex; align-items: center; gap: 4px; text-decoration: none; }
.acq-btn:hover { border-color: var(--wiki-accent); }
.acq-btn.active { background: var(--wiki-accent); border-color: var(--wiki-accent); color: white; }
.acq-btn img { width: 16px; height: 16px; }

.sort-select, .pp-select { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--wiki-border); background: var(--wiki-bg-card); color: var(--wiki-text-primary); font-size: 0.75rem; }
.sort-select:focus, .pp-select:focus { outline: none; border-color: var(--wiki-accent); }

.view-btns { display: flex; gap: 3px; }
.view-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--wiki-border); background: var(--wiki-bg-card); cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--wiki-text-muted); font-size: 0.9rem; }
.view-btn:hover { border-color: var(--wiki-accent); color: var(--wiki-accent); }
.view-btn.active { background: var(--wiki-accent); border-color: var(--wiki-accent); color: white; }

/* Cartes Hench style liste-henchs */
.hench-card { display: flex; flex-direction: column; background: var(--wiki-bg-card); border-radius: 10px; border: 2px solid var(--wiki-border); overflow: hidden; transition: all 0.2s; }
.hench-card:hover { box-shadow: var(--wiki-shadow-md); transform: translateY(-2px); }
.hench-card[data-race="0"]:hover { border-color: #e74c3c; }
.hench-card[data-race="1"]:hover { border-color: #9b59b6; }
.hench-card[data-race="2"]:hover { border-color: #e67e22; }
.hench-card[data-race="3"]:hover { border-color: #3498db; }
.hench-card[data-race="4"]:hover { border-color: #f06292; }
.hench-card[data-race="5"]:hover { border-color: #27ae60; }
.hench-card[data-race="6"]:hover { border-color: #f39c12; }
.hench-card[data-race="7"]:hover { border-color: #7f8c8d; }
.formula-card { display: flex; flex-direction: column; background: var(--wiki-bg-card); border-radius: 10px; border: 2px solid var(--wiki-border); overflow: hidden; transition: all 0.2s; }
.formula-card:hover { box-shadow: var(--wiki-shadow-md); transform: translateY(-2px); }
.formula-card[data-race="0"]:hover { border-color: #e74c3c; }
.formula-card[data-race="1"]:hover { border-color: #9b59b6; }
.formula-card[data-race="2"]:hover { border-color: #e67e22; }
.formula-card[data-race="3"]:hover { border-color: #3498db; }
.formula-card[data-race="4"]:hover { border-color: #f06292; }
.formula-card[data-race="5"]:hover { border-color: #27ae60; }
.formula-card[data-race="6"]:hover { border-color: #f39c12; }
.formula-card[data-race="7"]:hover { border-color: #7f8c8d; }
.hench-card-img { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
a.hench-card-img { cursor: pointer; text-decoration: none; }
.hench-card-img img.sprite { object-fit: contain; filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.6)); z-index: 2; }
.hench-card-img .badges { position: absolute; top: 6px; left: 6px; display: flex; flex-direction: column; gap: 3px; z-index: 3; }
.hench-card-img .badges img { width: 30px; height: 30px; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5)); }
.hench-info-bar { background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 100%); position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 8px; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 6px; }
.hench-info-bar a, .hench-info-bar .hench-name { color: white; text-decoration: none; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.hench-info-bar a:hover { color: var(--wiki-accent-gold, #FFD700); }
.hench-info-bar .lvl { color: rgba(255,255,255,0.7); font-size: 0.7rem; font-weight: 500; font-style: italic; flex-shrink: 0; }
.hench-race-bar { padding: 6px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.75rem; color: var(--wiki-text-secondary); background: var(--wiki-bg-tertiary); }
.hench-race-bar img { width: 16px; height: 16px; }
.hench-race-bar .grade-icon { width: 22px; height: 22px; border: 2px solid var(--wiki-border); border-radius: 4px; background: var(--wiki-bg-card); padding: 1px; }
.hench-race-bar .race-bar-separator { color: var(--wiki-text-muted); margin: 0 2px; }
.hench-race-bar .lvl { color: var(--wiki-text-muted); font-style: italic; }
.formula-card { cursor: pointer; }
.formula-card:hover .hench-name { color: var(--wiki-accent-gold, #FFD700); }
.hench-card:hover .hench-name { color: var(--wiki-accent-gold, #FFD700); }

.formula-toggle-btn { background: var(--wiki-bg-tertiary); border: 1px solid var(--wiki-border); border-radius: 50%; color: var(--wiki-text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.formula-toggle-btn:hover { background: var(--wiki-accent); border-color: var(--wiki-accent); color: white; }
.formula-toggle-btn i { transition: transform 0.3s; }

/* ==========================================
   MODE COLONNE (> 901px)
========================================== */
.hench-list.size-large { display: flex; flex-direction: column; gap: 1.5rem; }
.hench-list.size-large .hench-row { background: var(--wiki-bg-card); border-radius: 10px; border: 1px solid var(--wiki-border); padding: 1rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hench-list.size-large .hench-card { width: 228px; }
.hench-list.size-large .hench-card .hench-card-img { width: 228px; height: 167px; border-radius: 8px 8px 0 0; }
.hench-list.size-large .hench-card .hench-card-img img.sprite { width: 228px; height: 167px; }
.hench-list.size-large .hench-card .hench-card-img .badges img { width: 30px; height: 30px; }
.hench-list.size-large .hench-card .hench-info-bar { padding: 6px 8px; }
.hench-list.size-large .hench-card .hench-info-bar a { font-size: 0.85rem; }
.hench-list.size-large .hench-card .hench-info-bar .lvl { font-size: 0.75rem; }
.hench-list.size-large .hench-card .hench-race-bar { border-radius: 0 0 8px 8px; padding: 8px 12px; font-size: 0.8rem; }
.hench-list.size-large .formula-toggle-btn { width: 36px; height: 36px; font-size: 0.9rem; margin: 0.75rem 0; }
.hench-list.size-large .hench-row.expanded .formula-toggle-btn i { transform: rotate(180deg); }
.hench-list.size-large .hench-equal { font-size: 2rem; font-weight: 700; color: var(--wiki-accent); margin-bottom: 0.75rem; }
.hench-list.size-large .hench-formulas { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.hench-list.size-large .formula-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.hench-list.size-large .formula-card { width: 152px; }
.hench-list.size-large .formula-card .hench-card-img { width: 152px; height: 111px; border-radius: 6px 6px 0 0; }
.hench-list.size-large .formula-card .hench-card-img img.sprite { width: 152px; height: 111px; }
.hench-list.size-large .formula-card .hench-card-img .badges img { width: 30px; height: 30px; }
.hench-list.size-large .formula-card .hench-info-bar { padding: 4px 6px; }
.hench-list.size-large .formula-card .hench-info-bar a { font-size: 0.65rem; }
.hench-list.size-large .formula-card .hench-info-bar .lvl { font-size: 0.55rem; }
.hench-list.size-large .formula-card .hench-race-bar { border-radius: 0 0 6px 6px; padding: 6px 8px; font-size: 0.7rem; }
.hench-list.size-large .formula-card .hench-race-bar img { width: 14px; height: 14px; }
.hench-list.size-large .formula-card .hench-race-bar .grade-icon { width: 18px; height: 18px; }
.hench-list.size-large .formula-plus { font-size: 1.25rem; font-weight: 700; color: var(--wiki-text-muted); }
.hench-list.size-large .hench-row.collapsed .hench-equal, .hench-list.size-large .hench-row.collapsed .hench-formulas { display: none; }

/* ==========================================
   MODE LIGNE (> 901px)
========================================== */
.hench-list.size-medium { display: flex; flex-direction: column; gap: 1rem; }
.hench-list.size-medium .hench-row { background: var(--wiki-bg-card); border-radius: 10px; border: 1px solid var(--wiki-border); padding: 1rem; display: flex; align-items: center; gap: 1rem; }
.hench-list.size-medium .hench-card { width: 228px; flex-shrink: 0; }
.hench-list.size-medium .hench-card .hench-card-img { width: 228px; height: 167px; border-radius: 8px 8px 0 0; }
.hench-list.size-medium .hench-card .hench-card-img img.sprite { width: 228px; height: 167px; }
.hench-list.size-medium .hench-card .hench-card-img .badges img { width: 30px; height: 30px; }
.hench-list.size-medium .hench-card .hench-info-bar { padding: 6px 8px; }
.hench-list.size-medium .hench-card .hench-info-bar a { font-size: 0.85rem; }
.hench-list.size-medium .hench-card .hench-info-bar .lvl { font-size: 0.75rem; }
.hench-list.size-medium .hench-card .hench-race-bar { border-radius: 0 0 8px 8px; padding: 8px 12px; font-size: 0.8rem; }
.hench-list.size-medium .formula-toggle-btn { width: 36px; height: 36px; font-size: 0.9rem; }
.hench-list.size-medium .hench-row.expanded .formula-toggle-btn i { transform: rotate(180deg); }
.hench-list.size-medium .hench-equal { font-size: 2rem; font-weight: 700; color: var(--wiki-accent); flex-shrink: 0; }
.hench-list.size-medium .hench-formulas { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.hench-list.size-medium .formula-line { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.hench-list.size-medium .formula-card { width: 228px; }
.hench-list.size-medium .formula-card .hench-card-img { width: 228px; height: 167px; border-radius: 8px 8px 0 0; }
.hench-list.size-medium .formula-card .hench-card-img img.sprite { width: 228px; height: 167px; }
.hench-list.size-medium .formula-card .hench-card-img .badges img { width: 30px; height: 30px; }
.hench-list.size-medium .formula-card .hench-info-bar { padding: 6px 8px; }
.hench-list.size-medium .formula-card .hench-info-bar a { font-size: 0.8rem; }
.hench-list.size-medium .formula-card .hench-info-bar .lvl { font-size: 0.7rem; }
.hench-list.size-medium .formula-card .hench-race-bar { border-radius: 0 0 8px 8px; padding: 8px 12px; font-size: 0.8rem; }
.hench-list.size-medium .formula-card .hench-race-bar img { width: 16px; height: 16px; }
.hench-list.size-medium .formula-card .hench-race-bar .grade-icon { width: 22px; height: 22px; }
.hench-list.size-medium .formula-plus { font-size: 1.5rem; font-weight: 700; color: var(--wiki-text-muted); }
.hench-list.size-medium .hench-row.collapsed .hench-equal, .hench-list.size-medium .hench-row.collapsed .hench-formulas { display: none; }

/* ==========================================
   MODE COMPACT (> 901px)
========================================== */
.hench-list.size-small { display: flex; flex-direction: column; gap: 0.75rem; }
.hench-list.size-small .hench-row { background: var(--wiki-bg-card); border-radius: 8px; border: 1px solid var(--wiki-border); padding: 0.75rem; display: flex; align-items: center; gap: 0.75rem; }
.hench-list.size-small .hench-card { width: 114px; flex-shrink: 0; }
.hench-list.size-small .hench-card .hench-card-img { width: 114px; height: 83px; border-radius: 6px 6px 0 0; }
.hench-list.size-small .hench-card .hench-card-img img.sprite { width: 114px; height: 83px; }
.hench-list.size-small .hench-card .hench-card-img .badges img { width: 21px; height: 21px; }
.hench-list.size-small .hench-card .hench-info-bar { padding: 3px 5px; }
.hench-list.size-small .hench-card .hench-info-bar a { font-size: 0.6rem; }
.hench-list.size-small .hench-card .hench-info-bar .lvl { font-size: 0.5rem; }
.hench-list.size-small .hench-card .hench-race-bar { border-radius: 0 0 6px 6px; padding: 4px 8px; font-size: 0.65rem; }
.hench-list.size-small .hench-card .hench-race-bar img { width: 12px; height: 12px; }
.hench-list.size-small .hench-card .hench-race-bar .grade-icon { width: 14px; height: 14px; }
.hench-list.size-small .formula-toggle-btn { width: 28px; height: 28px; font-size: 0.7rem; }
.hench-list.size-small .hench-row.expanded .formula-toggle-btn i { transform: rotate(180deg); }
.hench-list.size-small .hench-equal { font-size: 1.25rem; font-weight: 700; color: var(--wiki-accent); flex-shrink: 0; }
.hench-list.size-small .hench-formulas { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.hench-list.size-small .formula-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.hench-list.size-small .formula-card { width: 80px; }
.hench-list.size-small .formula-card .hench-card-img { width: 80px; height: 58px; border-radius: 4px 4px 0 0; }
.hench-list.size-small .formula-card .hench-card-img img.sprite { width: 80px; height: 58px; }
.hench-list.size-small .formula-card .hench-card-img .badges img { width: 21px; height: 21px; }
.hench-list.size-small .formula-card .hench-info-bar { padding: 2px 4px; }
.hench-list.size-small .formula-card .hench-info-bar a { font-size: 0.5rem; }
.hench-list.size-small .formula-card .hench-info-bar .lvl { font-size: 0.45rem; }
.hench-list.size-small .formula-card .hench-race-bar { border-radius: 0 0 4px 4px; padding: 3px 5px; font-size: 0.5rem; }
.hench-list.size-small .formula-card .hench-race-bar img { width: 10px; height: 10px; }
.hench-list.size-small .formula-card .hench-race-bar .grade-icon { width: 12px; height: 12px; }
.hench-list.size-small .formula-plus { font-size: 1rem; font-weight: 700; color: var(--wiki-text-muted); }
.hench-list.size-small .hench-row.collapsed .hench-equal, .hench-list.size-small .hench-row.collapsed .hench-formulas { display: none; }
.hench-list.size-small .formula-plus { font-size: 1rem; font-weight: 700; color: var(--wiki-text-muted); }
.hench-list.size-small .hench-row.collapsed .hench-equal, .hench-list.size-small .hench-row.collapsed .hench-formulas { display: none; }

.no-formulas { color: var(--wiki-text-muted); font-size: 0.85rem; font-style: italic; }
.no-results { text-align: center; padding: 3rem; color: var(--wiki-text-muted); }
.no-results i { font-size: 2rem; opacity: 0.3; }
.no-results p { margin-top: 0.5rem; }

.hench-pagination { display: flex; justify-content: center; gap: 0.25rem; margin-top: 1.5rem; margin-bottom: 3rem; flex-wrap: wrap; }
.hench-pagination a, .hench-pagination span { padding: 6px 10px; border-radius: 6px; background: var(--wiki-bg-card); color: var(--wiki-text-secondary); text-decoration: none; border: 1px solid var(--wiki-border); font-size: 0.8rem; cursor: pointer; }
.hench-pagination a:hover, .hench-pagination .active { background: var(--wiki-accent); color: white; border-color: var(--wiki-accent); }

@media (max-width: 1200px) { .hench-list.size-medium .hench-row { flex-wrap: wrap; justify-content: flex-start; } .hench-list.size-medium .hench-formulas { width: 100%; } .hench-list.size-medium .formula-line { justify-content: flex-start; } }

/* ==========================================
   ≤901px - Layout UNIFIÉ OBLIGATOIRE - NE CHANGE PLUS JAMAIS
   RESULT = 228x167, FORMULES = 171x125 (75%)
   mapbg = hench-card-img = hench-card-bar = MÊME LARGEUR TOUJOURS
========================================== */
@media (max-width: 901px) {
    /* Forcer le layout colonne pour TOUS les modes */
    .hench-list.size-medium .hench-row,
    .hench-list.size-small .hench-row,
    .hench-list.size-large .hench-row {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    /* RESULT = 228x167 - mapbg = img = bar = MÊME LARGEUR */
    .hench-list.size-large .hench-card,
    .hench-list.size-medium .hench-card,
    .hench-list.size-small .hench-card { width: 228px !important; }
    
    .hench-list.size-large .hench-card-img,
    .hench-list.size-medium .hench-card-img,
    .hench-list.size-small .hench-card-img { width: 228px !important; height: 167px !important; }
    
    .hench-list.size-large .hench-card-img img.sprite,
    .hench-list.size-medium .hench-card-img img.sprite,
    .hench-list.size-small .hench-card-img img.sprite { width: 228px !important; height: 167px !important; }
    
    .hench-list.size-large .hench-card-img .badges img,
    .hench-list.size-medium .hench-card-img .badges img,
    .hench-list.size-small .hench-card-img .badges img { width: 30px !important; height: 30px !important; }
    
    .hench-list.size-large .hench-race-bar,
    .hench-list.size-medium .hench-race-bar,
    .hench-list.size-small .hench-race-bar { width: 228px !important; padding: 8px 12px !important; font-size: 0.8rem !important; }
    
    /* FORMULES = 171x125 (75% de 228x167) - mapbg = img = bar = MÊME LARGEUR */
    .hench-list.size-large .formula-card,
    .hench-list.size-medium .formula-card,
    .hench-list.size-small .formula-card { width: 171px !important; }
    
    .hench-list.size-large .formula-card .hench-card-img,
    .hench-list.size-medium .formula-card .hench-card-img,
    .hench-list.size-small .formula-card .hench-card-img { width: 171px !important; height: 125px !important; }
    
    .hench-list.size-large .formula-card .hench-card-img img.sprite,
    .hench-list.size-medium .formula-card .hench-card-img img.sprite,
    .hench-list.size-small .formula-card .hench-card-img img.sprite { width: 171px !important; height: 125px !important; }
    
    .hench-list.size-large .formula-card .hench-card-img .badges img,
    .hench-list.size-medium .formula-card .hench-card-img .badges img,
    .hench-list.size-small .formula-card .hench-card-img .badges img { width: 30px !important; height: 30px !important; }
    
    .hench-list.size-large .formula-card .hench-race-bar,
    .hench-list.size-medium .formula-card .hench-race-bar,
    .hench-list.size-small .formula-card .hench-race-bar { width: 171px !important; padding: 6px 10px !important; font-size: 0.75rem !important; }
    
    /* Formules en colonne en dessous du RESULT */
    .hench-list.size-large .hench-formulas,
    .hench-list.size-medium .hench-formulas,
    .hench-list.size-small .hench-formulas { 
        width: 100% !important; 
        flex-direction: column !important; 
        align-items: center !important;
        flex: none !important;
    }
    
    .hench-list.size-large .formula-line,
    .hench-list.size-medium .formula-line,
    .hench-list.size-small .formula-line { 
        justify-content: center !important; 
        flex-wrap: wrap !important;
    }
    
    /* Toggle et égal */
    .hench-list.size-large .formula-toggle-btn,
    .hench-list.size-medium .formula-toggle-btn,
    .hench-list.size-small .formula-toggle-btn { 
        width: 36px !important; 
        height: 36px !important; 
        margin: 0.75rem 0 !important; 
    }
    
    .hench-list.size-large .hench-equal,
    .hench-list.size-medium .hench-equal,
    .hench-list.size-small .hench-equal { 
        margin: 0.5rem 0 0.75rem 0 !important; 
        font-size: 2rem !important;
    }
    
    .hench-list.size-large .formula-plus,
    .hench-list.size-medium .formula-plus,
    .hench-list.size-small .formula-plus { 
        font-size: 1.25rem !important; 
    }
    
    /* Filtres responsive */
    .hench-filters { padding: 0.5rem; } 
    .hench-search { max-width: none; min-width: 100%; order: -1; }
    
    /* Banner responsive */
    .hench-banner-icon { width: 32px; height: 32px; }
    .hench-banner-icon img { width: 20px; height: 20px; }
    .hench-banner h1 { font-size: 1rem; }
    .hench-banner-stats { gap: 1rem; }
    
    .race-btn { width: 32px; height: 32px; }
    .race-btn img { width: 18px; height: 18px; }
    
    .acq-btn { padding: 5px 8px; font-size: 0.7rem; }
}

/* ==========================================
   ≤406px - Formules empilées verticalement
   avec bloc qui entoure chaque formule
========================================== */
@media (max-width: 406px) {
    .formula-line {
        flex-direction: column !important;
        gap: 0.5rem !important;
        background: var(--wiki-bg-tertiary, #2a2f3a) !important;
        padding: 0.75rem !important;
        border-radius: 8px !important;
        border: 1px solid var(--wiki-border, #4a4f65) !important;
    }
    .formula-plus {
        transform: rotate(90deg) !important;
    }
}

/* Boutons flottants avec FAB menu */
.floating-btns-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.floating-btns-container button { margin: 0; } /* Override mixmaster1.css */
.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
    margin: 0;
}
.float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.scroll-top-btn {
    background: var(--wiki-bg-tertiary, #3d4152);
    color: var(--wiki-text-primary, #e8eaf0);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}
.scroll-top-btn.visible.fab-open {
    transform: translateY(-230px) scale(1);
}
.scroll-top-btn:hover {
    background: var(--wiki-accent, #5E72AF);
    color: white;
    transform: scale(1.1);
}
.scroll-top-btn.visible.fab-open:hover {
    transform: translateY(-230px) scale(1.1);
}

/* Tooltip pour tous les boutons flottants */
.float-btn-tooltip {
    position: absolute;
    right: 60px;
    background: var(--wiki-bg-secondary);
    color: var(--wiki-text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid var(--wiki-border);
}
.float-btn:hover .float-btn-tooltip { opacity: 1; }
[data-theme="light"] .float-btn-tooltip { background: #fff; color: #333; border-color: #ddd; }

/* FAB Menu Principal */
.fab-menu { position: relative; }
.fab-main { background: var(--wiki-accent, #5E72AF); color: white; z-index: 2; }
.fab-main:hover { background: #4a5a8f; }
.fab-main i { transition: transform 0.3s ease; }
.fab-main.active i { transform: rotate(45deg); }
.fab-actions {
    position: absolute;
    bottom: 62px;
    right: 2px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}
.fab-menu.open .fab-actions { opacity: 1; visibility: visible; transform: translateY(0); }
.fab-action {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    position: relative;
    margin: 0;
}
.fab-action:hover { transform: scale(1.1); }
.fab-action.calc-btn { background: #e67e22; color: white; }
.fab-action.calc-btn:hover { background: #d35400; }
.fab-action.share-btn { background: #27ae60; color: white; }
.fab-action.share-btn:hover { background: #229954; }
.fab-action.tree-btn { background: #3498db; color: white; }
.fab-action.tree-btn:hover { background: #2980b9; }
.fab-action.settings-btn { background: var(--wiki-bg-tertiary, #3d4152); color: var(--wiki-text-primary); }
.fab-action.settings-btn:hover { background: #4a5a8f; color: white; }
.fab-action.settings-btn:hover i { animation: spin-gear 0.5s ease; }
.fab-action-tooltip {
    position: absolute;
    right: 55px;
    background: var(--wiki-bg-secondary);
    color: var(--wiki-text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid var(--wiki-border);
}
.fab-action:hover .fab-action-tooltip { opacity: 1; }
[data-theme="light"] .fab-action-tooltip { background: #fff; color: #333; border-color: #ddd; }

@keyframes spin-gear {
    from { transform: rotate(0deg); }
    to { transform: rotate(90deg); }
}
.settings-float-btn {
    background: var(--wiki-bg-tertiary, #3d4152);
    color: var(--wiki-text-primary, #e8eaf0);
}
.settings-float-btn:hover {
    background: var(--wiki-accent, #5E72AF);
    color: white;
}
.settings-float-btn:hover i {
    animation: spin-settings 0.5s ease;
}
@keyframes spin-settings {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}

/* Les CSS de la calculatrice sont dans inc/calculatrice_mix.php */

/* Bouton paramètres */
.settings-btn { position: relative; }
.settings-btn:hover i { animation: spin-slow 1s linear; }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }

/* Modale paramètres */
.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
}
.settings-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.settings-modal {
    background: var(--wiki-bg-secondary, #2d323e);
    border: 1px solid var(--wiki-border, #3d4354);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    margin: 20px auto;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
@media (max-width: 480px) {
    .settings-modal {
        width: 95%;
        border-radius: 12px;
        margin: 20px auto;
    }
    .settings-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .settings-select {
        width: 100%;
    }
}
.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wiki-border, #3d4354);
}
.settings-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--wiki-text-primary, #e8eaf0);
}
.settings-modal-header h3 i {
    color: var(--wiki-accent, #5E72AF);
}
.settings-modal-close {
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    color: var(--wiki-text-muted, #8890a8);
    cursor: pointer;
    transition: all 0.2s;
}
.settings-modal-close:hover {
    color: var(--wiki-text-primary, #e8eaf0);
}
.settings-modal-body {
    padding: 1.5rem;
}
.settings-group {
    margin-bottom: 1.5rem;
}
.settings-group:last-child {
    margin-bottom: 0;
}
.settings-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wiki-text-secondary, #b8bdd0);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--wiki-bg-tertiary, #3d4152);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}
.settings-option-text {
    font-size: 0.95rem;
    color: var(--wiki-text-primary, #e8eaf0);
}
.settings-hint {
    font-size: 0.8rem;
    color: var(--wiki-text-muted, #8890a8);
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
}
.settings-select {
    padding: 0.5rem 1rem;
    background: var(--wiki-bg-primary, #1a1d24);
    border: 1px solid var(--wiki-border, #3d4354);
    border-radius: 8px;
    color: var(--wiki-text-primary, #e8eaf0);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 120px;
}
.settings-select:focus {
    outline: none;
    border-color: var(--wiki-accent, #5E72AF);
}
.settings-select option {
    background: var(--wiki-bg-secondary, #2d323e);
    color: var(--wiki-text-primary, #e8eaf0);
}
.settings-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--wiki-border, #3d4354);
    display: flex;
    justify-content: flex-end;
}
.settings-save-btn {
    background: var(--wiki-accent, #5E72AF);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.settings-save-btn:hover {
    background: #4a5a8f;
    transform: translateY(-2px);
}

/* Modale Hench (mode fenêtré) */
.hench-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 1rem; }
.hench-modal-overlay.active { display: flex; }
.hench-modal { background: var(--wiki-bg-secondary); border-radius: 12px; width: 95%; height: 90%; max-width: 1400px; display: flex; flex-direction: column; border: 1px solid var(--wiki-border); }
.hench-modal-header { padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; color: var(--wiki-text); border-bottom: 1px solid var(--wiki-border); border-radius: 12px 12px 0 0; }
.hench-modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; color: var(--wiki-text-primary); }
.hench-modal-header h3 i { color: var(--wiki-accent); }
.hench-modal-close { background: none; border: none; color: var(--wiki-text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.hench-modal-close:hover { color: var(--wiki-text); }
.hench-modal-body { flex: 1; overflow: hidden; }
.hench-modal-body iframe { width: 100%; height: 100%; border: none; }
.hench-modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--wiki-border); display: flex; justify-content: flex-end; gap: 0.75rem; }
.hench-modal-footer .btn-action { padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 500; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; border: none; }
.hench-modal-footer .btn-primary { background: var(--wiki-accent); color: white; }
.hench-modal-footer .btn-primary:hover { background: #4a5a8f; }
.hench-modal-footer .btn-secondary { background: var(--wiki-bg-tertiary); color: var(--wiki-text); }
.hench-modal-footer .btn-secondary:hover { background: var(--wiki-border); }

/* 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;
    inset: 0;
    background: var(--wiki-bg-primary, #1a1d24);
    border: 2px solid var(--wiki-border, #3d4354);
    border-radius: 26px;
    transition: all 0.3s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--wiki-text-muted, #8890a8);
    border-radius: 50%;
    transition: all 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--wiki-accent, #5E72AF);
    border-color: var(--wiki-accent, #5E72AF);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background: white;
}

/* Breadcrumb */
.breadcrumb-nav { background:var(--wiki-bg-secondary);border-bottom:1px solid var(--wiki-border);padding:1rem 0; }
.breadcrumb-container { max-width:calc(1600px - 320px - 2rem);width:calc(100vw - 10rem);margin:0 auto;padding:0 2rem;display:flex;align-items:center;gap:0.5rem;font-size:0.9rem; }
.breadcrumb-nav a { color:var(--wiki-text-muted);text-decoration:none; }
.breadcrumb-nav a:hover { color:var(--wiki-accent); }
.breadcrumb-nav .separator { color:var(--wiki-text-muted); }
.breadcrumb-nav .current { color:var(--wiki-text-primary);font-weight:600; }

/* Modale Arbre de mix */
.arbre-modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,0.8);z-index:2000;display:none;align-items:center;justify-content:center;padding:1rem; }
.arbre-modal-overlay.active { display:flex; }
.arbre-modal { background:var(--wiki-bg-secondary);border-radius:12px;width:95%;height:90%;max-width:1400px;display:flex;flex-direction:column;border:1px solid var(--wiki-border); }
.arbre-modal-header { padding:1rem 1.25rem;display:flex;justify-content:space-between;align-items:center;color:var(--wiki-text);border-bottom:1px solid var(--wiki-border);border-radius:12px 12px 0 0; }
.arbre-modal-title { font-size:1.1rem;font-weight:600; }
.arbre-modal-close { background:none;border:none;color:var(--wiki-text-muted);font-size:1.5rem;cursor:pointer;line-height:1; }
.arbre-modal-close:hover { color:var(--wiki-text); }
.arbre-modal-body { flex:1;overflow:hidden; }
.arbre-modal-body iframe { width:100%;height:100%;border:none; }
.arbre-modal-footer { padding:1rem 1.25rem;border-top:1px solid var(--wiki-border);display:flex;justify-content:flex-end;gap:0.75rem; }
.arbre-modal-footer .btn-action { padding:0.6rem 1.2rem;border-radius:8px;font-weight:500;font-size:0.9rem;cursor:pointer;display:inline-flex;align-items:center;gap:0.5rem;text-decoration:none;border:none; }
.arbre-modal-footer .btn-tree { background:var(--wiki-accent);color:white; }
.arbre-modal-footer .btn-tree:hover { background:#4a5a8f; }
.arbre-modal-footer .btn-back { background:var(--wiki-bg-tertiary);color:var(--wiki-text); }
.arbre-modal-footer .btn-back:hover { background:var(--wiki-border); }

/* Toast unifié */
.toast { position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--wiki-bg-secondary);border:2px solid var(--wiki-border);padding:1rem 1.5rem;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,0.2);z-index:10001;display:none;align-items:center;gap:0.75rem;color:var(--wiki-text);font-weight:500; }
.toast::before, .toast::after { content:none !important;display:none !important; }
.toast.show { display:flex;animation:slideUp 0.3s ease; }
.toast.success { border-color:#27ae60;background:linear-gradient(90deg, rgba(39,174,96,0.1) 0%, var(--wiki-bg-secondary) 100%); }
.toast.success .toast-icon { color:#27ae60; }
.toast.error { border-color:#e74c3c;background:linear-gradient(90deg, rgba(231,76,60,0.1) 0%, var(--wiki-bg-secondary) 100%); }
.toast.error .toast-icon { color:#e74c3c; }
.toast.info { border-color:#3498db;background:linear-gradient(90deg, rgba(52,152,219,0.1) 0%, var(--wiki-bg-secondary) 100%); }
.toast.info .toast-icon { color:#3498db; }
.toast-icon { flex-shrink:0; }
@keyframes slideUp { from { transform: translateX(-50%) translateY(20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
