/* =============================================================================
   PALETTE — thème sombre (défaut) et thème clair
   -----------------------------------------------------------------------------
   Deux variables font l'essentiel du travail :

   --tint  : la teinte des surfaces translucides. Toute l'interface est bâtie
             sur des « rgba(blanc, 0.08) » posés sur du sombre ; sur un fond
             clair ils deviennent invisibles. En passant la teinte au bleu-nuit,
             les 275 surfaces concernées se retournent d'un coup.
   --shade : la teinte des ombres, allégée en clair — du noir pur sur du blanc
             fait sale.

   Les accents « clairs » (vert d'eau, or pâle, violet pastel) sont calibrés
   pour ressortir sur du sombre : sur du blanc ils sont illisibles, ils ont donc
   leur propre valeur en thème clair.
   ========================================================================== */
:root {
    --title-start: #ffffff;
    --text-soft: #cbd5e1;
    --on-surface: #fff;
    --on-accent: #fff;
    --panel: 12, 16, 28;
    --tint: 255, 255, 255;
    --shade: 0, 0, 0;

    --bg-dark: #0a0c12;
    --bg-card: rgba(var(--panel), 0.75);
    --bg-card-hover: rgba(var(--panel), 0.9);
    --bg-modal: #121622;
    --border-color: rgba(var(--tint), 0.08);
    --border-glow: rgba(168, 85, 247, 0.3);

    --purple-main: #a855f7;
    --purple-light: #c084fc;
    --purple-soft: #a78bfa;
    --purple-pale: #c4b5fd;
    --purple-deep: #8b5cf6;
    --purple-dark: #6d28d9;
    --purple-glow: rgba(168, 85, 247, 0.35);

    --green-main: #10b981;
    --green-light: #34d399;
    --green-deep: #059669;
    --green-glow: rgba(16, 185, 129, 0.35);

    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --gold-glow: rgba(245, 158, 11, 0.35);

    --boss-red: #ef4444;
    --red-light: #f87171;
    --red-pale: #fca5a5;
    --boss-red-glow: rgba(239, 68, 68, 0.3);

    --blue-light: #38bdf8;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --p1-color: #38bdf8;
    --p2-color: #a855f7;
    --p3-color: #f59e0b;
    --p4-color: #ec4899;
    --p5-color: #ef4444;

    --glass-blur: blur(16px);
    --glass-bg: rgba(var(--panel), 0.75);
    --glass-border: 1px solid rgba(var(--tint), 0.08);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
}

html[data-theme="light"] {
    --title-start: #1e1b4b;
    --text-soft: #334155;
    --on-surface: #0f172a;
    --on-accent: #fff;
    --panel: 255, 255, 255;
    --tint: 15, 23, 42;
    --shade: 148, 163, 184;

    --bg-dark: #eef2f7;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: #ffffff;
    --bg-modal: #ffffff;
    --border-color: rgba(var(--tint), 0.14);
    --border-glow: rgba(126, 34, 206, 0.35);

    /* Assombris d'un ou deux crans : les pastels du thème sombre passent au
       travers d'un fond blanc. */
    --purple-main: #7e22ce;
    --purple-light: #6d28d9;
    --purple-soft: #7c3aed;
    --purple-pale: #6d28d9;
    --purple-deep: #6d28d9;
    --purple-dark: #581c87;
    --purple-glow: rgba(126, 34, 206, 0.22);

    --green-main: #047857;
    --green-light: #059669;
    --green-deep: #065f46;
    --green-glow: rgba(4, 120, 87, 0.22);

    --gold: #b45309;
    --gold-light: #a16207;
    --gold-glow: rgba(180, 83, 9, 0.22);

    --boss-red: #b91c1c;
    --red-light: #dc2626;
    --red-pale: #b91c1c;
    --boss-red-glow: rgba(185, 28, 28, 0.22);

    --blue-light: #0369a1;

    --text-main: #0f172a;
    --text-muted: #475569;

    --p1-color: #0369a1;
    --p2-color: #7e22ce;
    --p3-color: #b45309;
    --p4-color: #be185d;
    --p5-color: #b91c1c;

    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: 1px solid rgba(var(--tint), 0.14);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Dégradés d'ambiance sur un calque fixe plutôt qu'en background-attachment:
   fixed sur le body : un fond « fixed » force le navigateur à repeindre tout le
   viewport à chaque cran de molette. Même rendu, défilement fluide. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: var(--ambiance, 1);
    background-image:
        radial-gradient(at 15% 20%, rgba(168, 85, 247, 0.08) 0px, transparent 55%),
        radial-gradient(at 85% 15%, rgba(16, 185, 129, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 85%, rgba(245, 158, 11, 0.06) 0px, transparent 55%);
}

/* Deux halos de 600 et 700 px floutés à 130 px. En `absolute` ils défilaient
   avec la page, et le navigateur devait re-tramer cette énorme surface floue à
   chaque image ; en `fixed` + `will-change`, ils deviennent une texture que le
   compositeur se contente de déplacer. L'effet est le même — ce sont des taches
   d'ambiance, on ne voit pas qu'elles ne défilent plus. */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.bg-glow-purple {
    top: -120px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, rgba(var(--shade), 0) 70%);
}

.bg-glow-green {
    top: 35%;
    right: -150px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(var(--shade), 0) 70%);
}

.app-container {
    max-width: none;
    margin: 0 0 0 var(--sidebar-w);
    padding: 1.5rem 2rem 3rem;
    position: relative;
    z-index: 1;
}

.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(12px);
    color: var(--on-surface);
    padding: 1rem 1.5rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 15px 30px rgba(var(--shade), 0.6), 0 0 20px rgba(16, 185, 129, 0.4);
    z-index: 9999;
    font-weight: 600;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.toast-icon {
    font-size: 1.25rem;
}

/* =========================================================
   TOPBAR — Header sticky 3-colonnes premium
   ========================================================= */
/* ===== SIDEBAR ===== */
:root { --sidebar-w: 220px; }

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.25rem 0.85rem 1.25rem;
    background: rgba(var(--panel), 0.92);
    border-right: 1px solid rgba(var(--tint), 0.07);
    border-radius: 0;
    box-shadow: 4px 0 30px rgba(var(--shade), 0.5);
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--tint), 0.08) transparent;
}

.site-main-logo {
    max-height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.site-main-logo:hover {
    transform: scale(1.06);
    filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.7));
}

.topbar-nav {
    flex: 1;
    display: block;
    overflow: visible;
    min-width: 0;
}

.topbar-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(var(--tint), 0.07);
    flex-shrink: 0;
}

/* Bouton utilitaire topbar (Sauvegardes, Groupe) */
.topbar-btn {
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.08);
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    width: 100%;
}

.topbar-btn:hover {
    background: rgba(var(--tint), 0.1);
    border-color: rgba(var(--tint), 0.2);
    color: var(--on-surface);
    transform: translateY(-1px);
}

.topbar-btn i {
    font-size: 0.85rem;
}

.topbar-btn-label {
    font-size: 0.82rem;
}

/* Bouton connexion */
.auth-btn-login {
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, var(--purple-main), #7c3aed);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    color: var(--on-surface);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
    width: 100%;
    white-space: nowrap;
}

.auth-btn-login:hover {
    background: linear-gradient(135deg, var(--purple-light), var(--purple-main));
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
}

/* Bouton déconnexion */
.logout-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--red-light);
}

/* User profile widget */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.08);
    border-radius: 14px;
    padding: 0.4rem 0.6rem 0.4rem 0.45rem;
    width: 100%;
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--purple-main);
    object-fit: cover;
    box-shadow: 0 0 10px var(--purple-glow);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-status {
    font-size: 0.72rem;
    color: var(--green-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sync-dot {
    font-size: 0.45rem;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Auth container */
.auth-widget {
    display: flex;
    align-items: center;
}

.btn {
    font-family: var(--font-body);
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-main), #7e22ce);
    color: var(--on-surface);
    box-shadow: 0 6px 20px var(--purple-glow);
    border: 1px solid rgba(var(--tint), 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, var(--purple-light), var(--purple-main));
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(var(--tint), 0.12);
    border-color: rgba(var(--tint), 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--green-main), var(--green-deep));
    color: var(--on-surface);
    box-shadow: 0 6px 20px var(--green-glow);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--green-light), var(--green-main));
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--boss-red), #dc2626);
    color: var(--on-surface);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--red-light), var(--boss-red));
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(var(--tint), 0.08);
    border-color: var(--on-surface);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--on-surface);
    background: rgba(var(--tint), 0.12);
    border-color: rgba(var(--tint), 0.2);
}

.btn-edit-item:hover {
    color: var(--blue-light);
    border-color: var(--blue-light);
}

.btn-delete-item:hover {
    color: var(--boss-red);
    border-color: var(--boss-red);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(var(--panel), 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--tint), 0.07);
    padding: 1.4rem 1.6rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    box-shadow: 0 8px 24px rgba(var(--shade), 0.35);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--tint), 0.02) 0%, transparent 60%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--tint), 0.14);
    box-shadow: 0 14px 36px rgba(var(--shade), 0.45);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.purple-glow {
    background: rgba(168, 85, 247, 0.12);
    color: var(--purple-light);
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.green-glow {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-light);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.red-glow {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-light);
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.gold-glow {
    background: rgba(245, 158, 11, 0.12);
    color: var(--gold-light);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.stat-info {
    min-width: 0;
    flex: 1;
}

.stat-info .stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    display: block;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-info h3 {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--title-start) 0%, var(--text-soft) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}



/* Navigation tabs pill */
.prestige-tabs {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    gap: 2px;
    box-shadow: none;
}

.mode-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    color: rgba(148, 163, 184, 0.7);
    border-radius: 11px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-btn .tab-label {
    font-size: 0.88rem;
    display: block;
}

.tab-btn:hover {
    color: rgba(var(--tint), 0.85);
    background: rgba(var(--tint), 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(109, 40, 217, 0.95));
    color: var(--on-surface);
    box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4), inset 0 1px 0 rgba(var(--tint), 0.15);
}

/* =========================================================
   FILTER BAR
   ========================================================= */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: rgba(var(--tint), 0.02);
    border: 1px solid rgba(var(--tint), 0.06);
    border-radius: 18px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 340px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.08);
    padding: 0.6rem 0.9rem 0.6rem 2.6rem;
    border-radius: 12px;
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.22s;
}

.search-box input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.search-box input:focus {
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.06);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.filter-options {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.filter-tag {
    background: transparent;
    border: 1px solid rgba(var(--tint), 0.08);
    color: var(--text-muted);
    padding: 0.45rem 1rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-tag:hover {
    color: var(--on-surface);
    background: rgba(var(--tint), 0.07);
    border-color: rgba(var(--tint), 0.15);
}

.filter-tag.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.85), rgba(109, 40, 217, 0.9));
    color: var(--on-surface);
    border-color: rgba(192, 132, 252, 0.4);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
}

.dofus-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(var(--tint), 0.02);
    padding: 0.4rem 0.6rem;
    border-radius: 16px;
    border: 1px solid rgba(var(--tint), 0.06);
    backdrop-filter: blur(8px);
}

.dofus-tag {
    background: rgba(var(--tint), 0.03);
    border: 1px solid rgba(var(--tint), 0.05);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dofus-tag:hover {
    color: var(--on-surface);
    background: rgba(var(--tint), 0.08);
    border-color: rgba(var(--tint), 0.15);
    transform: translateY(-1px);
}

.dofus-tag[data-dofus-filter="all"].active {
    background: linear-gradient(135deg, var(--purple-main) 0%, #7e22ce 100%);
    color: var(--on-surface);
    border-color: var(--purple-light);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.dofus-tag[data-dofus-filter="P0"].active {
    background: linear-gradient(135deg, var(--green-main) 0%, var(--green-deep) 100%);
    color: var(--on-surface);
    border-color: var(--green-light);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.dofus-tag[data-dofus-filter="P1"].active {
    background: linear-gradient(135deg, var(--blue-light) 0%, #0284c7 100%);
    color: var(--on-surface);
    border-color: #7dd3fc;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.dofus-tag[data-dofus-filter="P2"].active {
    background: linear-gradient(135deg, var(--purple-main) 0%, #7e22ce 100%);
    color: var(--on-surface);
    border-color: var(--purple-light);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.dofus-tag[data-dofus-filter="P3"].active {
    background: linear-gradient(135deg, var(--gold) 0%, #d97706 100%);
    color: var(--on-surface);
    border-color: var(--gold-light);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.dofus-tag[data-dofus-filter="P4"].active {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: var(--on-surface);
    border-color: #f472b6;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.dofus-tag[data-dofus-filter="P5"].active {
    background: linear-gradient(135deg, var(--boss-red) 0%, #b91c1c 100%);
    color: var(--on-surface);
    border-color: var(--red-light);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.item-slot-frame {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: rgba(var(--panel), 0.9);
    border: 2px solid rgba(var(--tint), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: inset 0 0 20px rgba(var(--shade), 0.8), 0 4px 15px rgba(var(--shade), 0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-slot-frame[style*="cursor: pointer"]:hover {
    border-color: var(--purple-main) !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5), inset 0 0 10px rgba(168, 85, 247, 0.2);
    transform: translateY(-2px) scale(1.05);
}

.item-slot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    transition: transform 0.3s ease;
}

.item-card:hover .item-slot-img {
    transform: scale(1.1);
}

.slot-fallback-icon {
    font-size: 2.2rem;
    color: var(--purple-light);
    opacity: 0.8;
}

.item-slot-big {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    background: rgba(var(--panel), 0.95);
    border: 2px solid var(--purple-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 25px var(--purple-glow), inset 0 0 20px rgba(var(--shade), 0.8);
}

.item-slot-big img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.item-slot-big i {
    font-size: 2.8rem;
    color: var(--purple-light);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.75rem;
}

.item-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 1.75rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple-main), transparent);
    opacity: 0.5;
    transition: opacity 0.3s;
}

.item-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--tint), 0.2);
    box-shadow: 0 20px 40px rgba(var(--shade), 0.5), 0 0 25px var(--purple-glow);
}

.item-card:hover::before {
    opacity: 1;
    background: linear-gradient(90deg, var(--purple-light), var(--green-light));
}

.item-card.crafted {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.item-card.crafted::before {
    background: linear-gradient(90deg, var(--green-main), transparent);
}

.item-card.crafted .item-slot-frame {
    border-color: var(--green-main);
    box-shadow: 0 0 15px var(--green-glow);
}

.item-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.item-title-box {
    flex-grow: 1;
}

.item-title-box h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.badge-type {
    background: rgba(var(--tint), 0.08);
    color: var(--text-muted);
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.crafted-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--green-light);
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.item-progress {
    margin-bottom: 1.5rem;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-percent {
    font-weight: 800;
    color: var(--on-surface);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(var(--tint), 0.06);
    border-radius: 999px;
    overflow: hidden;
    padding: 2px;
    border: 1px solid rgba(var(--tint), 0.1);
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-purple {
    background: linear-gradient(90deg, var(--purple-light), #9333ea);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

.fill-gold {
    background: linear-gradient(90deg, var(--gold-light), var(--gold));
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.fill-success {
    background: linear-gradient(90deg, var(--green-light), var(--green-main));
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.item-footer {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.btn-card {
    flex: 1;
    padding: 0.7rem;
    border-radius: 11px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid rgba(var(--tint), 0.07);
    background: rgba(var(--tint), 0.04);
    color: rgba(var(--tint), 0.7);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-card:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.85), rgba(109, 40, 217, 0.9));
    color: var(--on-surface);
    border-color: rgba(192, 132, 252, 0.3);
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
}

/* =========================================================
   MINI RESOURCE PREVIEW TAGS on item cards
   ========================================================= */
.mini-res-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.mini-res-tag {
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.07);
    color: rgba(148, 163, 184, 0.9);
    padding: 0.25rem 0.6rem;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.mini-res-tag.completed {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--green-light);
}

/* =========================================================
   PRESTIGE ACTIONS BANNER
   ========================================================= */
.prestige-actions-banner {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
}

.prestige-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
    flex-wrap: wrap;
}

.prestige-banner-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(192, 132, 252, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prestige-banner-title i {
    color: var(--gold-light);
}

.prestige-banner-buttons {
    display: flex;
    gap: 0.6rem;
}

/* =========================================================
   GROUPE BUTTON (header)
   ========================================================= */
.btn-group-header {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: var(--green-light) !important;
}

.btn-group-header:hover {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #6ee7b7 !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }

    .topbar {
        position: sticky;
        top: 0;
        left: unset;
        height: auto;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.65rem 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(var(--tint), 0.07);
        overflow: visible;
        margin-bottom: 1.25rem;
        border-radius: 0 0 16px 16px;
    }

    .topbar-nav {
        flex: 1;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .topbar-nav::-webkit-scrollbar { display: none; }

    .prestige-tabs {
        flex-direction: row;
        background: rgba(var(--shade), 0.4);
        border: 1px solid rgba(var(--tint), 0.07);
        padding: 4px;
        border-radius: 14px;
        gap: 2px;
    }

    .tab-btn {
        width: auto;
        flex-direction: row;
    }

    .tab-btn .tab-label {
        display: none;
    }

    .topbar-right {
        flex-direction: row;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        gap: 0.4rem;
    }

    .topbar-btn {
        width: auto;
    }

    .auth-btn-login {
        width: auto;
    }

    .user-profile {
        width: auto;
    }

    .topbar-btn-label {
        display: none;
    }

    .app-container {
        margin-left: 0;
        padding: 0.75rem 1rem 2rem;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0.75rem 1rem;
    }

    .stats-overview {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-info h3 {
        font-size: 1.3rem;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .filter-options {
        margin-left: 0;
        justify-content: center;
    }
}

.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    border: var(--glass-border);
}

.empty-icon-box {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: rgba(var(--tint), 0.05);
    border: 1px solid rgba(var(--tint), 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--purple-light);
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 20px rgba(var(--tint), 0.02);
}

.empty-state h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 450px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.btn-subfilter {
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-subfilter:hover {
    color: var(--on-surface);
    background: rgba(var(--tint), 0.1);
}

.btn-subfilter.active {
    background: var(--purple-main);
    color: var(--on-surface);
    border-color: var(--purple-light);
    box-shadow: 0 0 20px var(--purple-glow);
}

.res-consolidated-card {
    background: rgba(var(--tint), 0.03);
    border: 1px solid rgba(var(--tint), 0.08);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.2s;
}

.res-consolidated-card:hover {
    border-color: rgba(var(--tint), 0.25);
    background: rgba(var(--tint), 0.07);
    transform: translateY(-2px);
}

.res-consolidated-card.boss {
    border-left: 4px solid var(--boss-red);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), rgba(var(--tint), 0.02));
}

.res-consolidated-card.completed {
    border-left: 4px solid var(--green-main);
    opacity: 0.75;
}

.res-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.res-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(var(--tint), 0.05);
    border: 1px solid rgba(var(--tint), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--purple-light);
}

.res-consolidated-card.boss .res-icon {
    color: var(--boss-red);
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.res-name-area h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.zone-tag {
    font-size: 0.68rem;
    color: rgba(var(--tint), 0.3);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.18rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.res-progress {
    text-align: right;
}

.res-progress-numbers {
    font-size: 1.25rem;
    font-weight: 800;
}

.res-progress-numbers .current {
    color: var(--purple-light);
}

.res-progress-numbers .req {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--panel), 0.85);
    backdrop-filter: blur(12px);
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid rgba(var(--tint), 0.15);
    border-radius: 28px;
    width: 100%;
    position: relative;
    z-index: 1000;
    box-shadow: 0 30px 70px -15px rgba(var(--shade), 0.8), 0 0 40px rgba(168, 85, 247, 0.2);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.item-detail-modal {
    max-width: 1050px;
}

.add-item-modal {
    max-width: 900px;
}

.db-modal {
    max-width: 650px;
}

.modal-header {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--shade), 0.2);
}

.modal-title-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.modal-title-text h2 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 900;
    margin-top: 0.3rem;
}

.prestige-tag-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.prestige-pill {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.2);
    color: var(--purple-light);
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.category-pill {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    background: rgba(var(--tint), 0.08);
    color: var(--text-muted);
}

.modal-header-btns {
    display: flex;
    gap: 0.6rem;
}

.modal-body {
    padding: 2.5rem;
    overflow-y: auto;
}

.item-progress-card {
    background: rgba(var(--tint), 0.02);
    border: 1px solid rgba(var(--tint), 0.08);
    padding: 1.75rem;
    border-radius: 20px;
    margin-bottom: 2.5rem;
    box-shadow: inset 0 0 20px rgba(var(--shade), 0.3);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.progress-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-reset:hover {
    color: var(--boss-red);
    border-color: var(--boss-red);
}

.resources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.resources-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.count-badge {
    background: rgba(168, 85, 247, 0.2);
    color: var(--purple-light);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ---- Resource cards ---- */
.resources-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.resource-item-row {
    background: rgba(var(--tint), 0.025);
    border: 1px solid rgba(var(--tint), 0.07);
    border-left: 3px solid rgba(var(--tint), 0.07);
    border-radius: 13px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background 0.15s, border-color 0.15s;
}

.resource-item-row:hover {
    background: rgba(var(--tint), 0.04);
    border-color: rgba(var(--tint), 0.13);
}

.resource-item-row.is-boss {
    border-left: 3px solid rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.025);
}

.resource-item-row.is-completed {
    border-left: 3px solid rgba(16, 185, 129, 0.6);
    background: rgba(16, 185, 129, 0.035);
    border-color: rgba(16, 185, 129, 0.17);
}

/* Dofus de fusion : cartes du Dofus à fondre, sous son ingrédient. */
.sous-cartes {
    margin: -4px 0 4px 18px;
    padding: 8px 10px;
    border-left: 2px dashed rgba(var(--tint), 0.15);
}
.sous-cartes-titre {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.sous-cartes-note { font-weight: 400; opacity: .8; }
.sous-cartes-liste { display: flex; flex-wrap: wrap; gap: 5px; }
.sous-carte {
    font: inherit;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
    color: var(--text-main, inherit);
    cursor: pointer;
}
.sous-carte i { font-size: 10px; margin-right: 3px; opacity: .8; }
.sous-carte:hover { border-color: rgba(239, 68, 68, 0.7); }
.sous-carte.ok {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}
html[data-theme="light"] .sous-carte.ok { color: #047857; }

.res-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
}

.res-row-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.res-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-soft);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.resource-item-row.is-boss .res-row-icon {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--red-light);
}

.resource-item-row.is-completed .res-row-icon {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: var(--green-light);
}

.res-row-title {
    min-width: 0;
    overflow: hidden;
}

.res-row-title h4 {
    font-size: 0.86rem;
    font-weight: 700;
    margin: 0 0 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.3;
    color: var(--text-main);
}

.res-row-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Thin progress bar at the bottom of each card */
.res-progress-bar {
    height: 3px;
    background: rgba(var(--tint), 0.05);
}
.res-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple-dark), var(--purple-main));
    transition: width 0.3s ease;
}
.resource-item-row.is-completed .res-progress-fill {
    background: linear-gradient(90deg, var(--green-deep), var(--green-main));
}

/* Quantity controller */
.quantity-controller {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(var(--shade), 0.3);
    border: 1px solid rgba(var(--tint), 0.08);
    padding: 3px;
    border-radius: 8px;
    flex-shrink: 0;
}

.btn-qty {
    width: 25px;
    height: 25px;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: rgba(var(--tint), 0.4);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-family: var(--font-body);
}

.btn-qty:hover {
    background: rgba(168, 85, 247, 0.3);
    color: var(--purple-pale);
}

.input-qty {
    width: 36px;
    background: transparent;
    border: none;
    color: var(--on-surface);
    text-align: center;
    font-weight: 800;
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-body);
}

.btn-max {
    background: rgba(168, 85, 247, 0.1);
    color: var(--purple-pale);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 0.28rem 0.65rem;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-max:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.45);
    color: #ede9fe;
}

.btn-min {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-soft);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.28rem 0.65rem;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-min:hover {
    background: rgba(148, 163, 184, 0.22);
    border-color: rgba(148, 163, 184, 0.45);
    color: #f1f5f9;
}

.res-name-copy {
    cursor: pointer;
    transition: color 0.15s;
}

.res-name-copy:hover {
    color: var(--purple-pale);
}

.modal-footer {
    padding: 1.75rem 2.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(var(--shade), 0.25);
}

.form-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.col-4 {
    flex: 4;
}

.col-2 {
    flex: 2;
}

.col-3 {
    flex: 3;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    background: rgba(var(--shade), 0.6);
    border: 1px solid rgba(var(--tint), 0.15);
    padding: 0.9rem 1.15rem;
    border-radius: 14px;
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--purple-light);
    box-shadow: 0 0 15px var(--purple-glow);
}

.form-group select option {
    background: #121622;
    color: var(--on-surface);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    left: 1.15rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-with-icon input {
    width: 100%;
    padding-left: 3rem;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.mb-4 {
    margin-bottom: 1.75rem;
}

.resources-builder {
    background: rgba(var(--tint), 0.02);
    border: 1px solid rgba(var(--tint), 0.1);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 2.5rem;
    box-shadow: inset 0 0 20px rgba(var(--shade), 0.3);
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(var(--tint), 0.08);
    padding-bottom: 1.25rem;
}

.builder-title h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.builder-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.resource-rows {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.res-edit-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(var(--shade), 0.4);
    padding: 1.15rem;
    border-radius: 16px;
    border: 1px solid rgba(var(--tint), 0.1);
}

.res-edit-row input[type="text"] {
    background: rgba(var(--tint), 0.05);
    border: 1px solid rgba(var(--tint), 0.12);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    color: var(--on-surface);
    font-family: var(--font-body);
}

.res-input-name {
    flex: 2;
}

.res-input-zone {
    flex: 2;
}

.res-input-req {
    width: 100px;
    text-align: center;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red-light);
    font-weight: 700;
    font-size: 0.9rem;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--boss-red);
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.db-section {
    padding: 0.75rem 0;
}

.db-section h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.db-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.separator {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.75rem 0;
}

.import-file-box {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.file-input {
    display: none;
}

.file-label {
    padding: 0.8rem 1.5rem;
    background: var(--purple-main);
    color: var(--on-surface);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px var(--purple-glow);
}

.file-label:hover {
    background: var(--purple-light);
    transform: translateY(-1px);
}

.file-name {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.danger-zone h3 {
    color: var(--boss-red);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes floatLeaf {
    0% {
        transform: translateY(0px) rotate(-5deg);
    }

    100% {
        transform: translateY(-5px) rotate(10deg);
    }
}

@media (max-width: 900px) {
    .res-edit-row {
        flex-wrap: wrap;
    }

    .res-input-name,
    .res-input-zone {
        flex: 1 1 100%;
    }
}

.mini-res-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(var(--tint), 0.06);
}

.mini-res-tag {
    font-size: 0.78rem;
    background: rgba(var(--tint), 0.06);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.mini-res-tag:hover {
    background: rgba(var(--tint), 0.12);
}

.mini-res-tag.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-main);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.mini-res-tag strong {
    color: var(--on-surface);
    font-weight: 700;
}

.mini-res-tag.completed strong {
    color: var(--green-main);
}

.req-pill {
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(168, 85, 247, 0.13);
    color: var(--purple-pale);
    padding: 1px 6px;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.res-progress-fraction {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(var(--tint), 0.38);
    white-space: nowrap;
    min-width: 38px;
    text-align: right;
}

.resource-item-row.is-completed .res-progress-fraction {
    color: var(--green-light);
}

.step-num {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple-main), #7e22ce);
    color: var(--on-surface);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--purple-glow);
    flex-shrink: 0;
}

.step-desc h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--on-surface);
    margin-bottom: 0.4rem;
}

.step-desc p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.step-desc strong {
    color: var(--text-soft);
}

.element-table-wrapper,
.jetons-table-wrapper {
    padding: 1.5rem;
    overflow-x: auto;
}

.tier-pill {
    background: rgba(var(--tint), 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-weight: 800;
    color: var(--on-surface);
}

.primo-qty-ctrl {
    display: inline-flex;
    align-items: center;
    background: rgba(var(--shade), 0.6);
    border: 1px solid rgba(var(--tint), 0.15);
    border-radius: 10px;
    overflow: hidden;
    padding: 2px;
}

.primo-qty-ctrl button {
    width: 28px;
    height: 28px;
    background: rgba(var(--tint), 0.08);
    border: none;
    color: var(--on-surface);
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.primo-qty-ctrl button:hover {
    background: var(--purple-main);
}

.primo-qty-ctrl input {
    width: 48px;
    background: transparent;
    border: none;
    color: var(--on-surface);
    text-align: center;
    font-weight: 800;
    font-size: 0.95rem;
    outline: none;
    font-family: var(--font-body);
}

.primo-qty-ctrl input::-webkit-outer-spin-button,
.primo-qty-ctrl input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.primo-qty-ctrl input[type=number] {
    -moz-appearance: textfield;
}

.casse-restant-val {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gold-light);
}

.casse-restant-val.zero {
    color: var(--green-main);
}

.stat-dj {
    color: var(--blue-light);
    font-weight: 800;
    font-size: 1.15rem;
}

.sub-run {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-weight: 600;
}

.col-active {
    background: rgba(var(--tint), 0.08) !important;
    border-left: 1px solid rgba(236, 72, 153, 0.4);
    border-right: 1px solid rgba(236, 72, 153, 0.4);
    box-shadow: inset 0 0 15px rgba(236, 72, 153, 0.15);
}

/* Jetons Info Banner & Mode Selection */
.jetons-header {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.25), rgba(244, 63, 94, 0.05));
    border-top: 4px solid #ec4899;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.jetons-mode-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.jetons-info-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: rgba(var(--shade), 0.3);
    border-bottom: 1px solid rgba(var(--tint), 0.08);
}

.jetons-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.jetons-title h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.jetons-icon {
    font-size: 1.8rem;
    color: #ec4899;
    filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.5));
}

.jetons-table {
    font-size: 1rem;
}

.jeton-name-pill {
    background: rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f472b6;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
}

.stat-highlight {
    font-weight: 800;
    color: var(--on-surface);
}

.stat-missing {
    color: #f43f5e;
    font-weight: 800;
}

.stat-missing.zero {
    color: var(--green-main);
}

/* Utils */
.hidden {
    display: none !important;
}

.item-description {
    background: rgba(var(--tint), 0.05);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: rgba(var(--tint), 0.8);
    margin-bottom: 1rem;
    white-space: pre-line;
    border-left: 4px solid var(--green-main);
}

/* Google Auth Widget */
.auth-widget {
    display: inline-flex;
    align-items: center;
}

.btn-google {
    background: rgba(var(--tint), 0.08);
    border: 1px solid rgba(var(--tint), 0.15);
    color: var(--on-surface);
    font-weight: 600;
    padding: 0.8rem 1.4rem;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.btn-google i {
    color: #4285F4;
    font-size: 1rem;
}

.btn-google:hover {
    background: rgba(var(--tint), 0.14);
    border-color: rgba(var(--tint), 0.25);
    transform: translateY(-1px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.08);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--purple-light);
    box-shadow: 0 0 10px var(--purple-glow);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--on-surface);
    font-size: 0.85rem;
    font-weight: 700;
}

.sync-status {
    color: var(--green-main);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sync-status.offline {
    color: #f43f5e;
}

.btn-logout-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout-icon:hover {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}

/* Panneau de statistiques cumulées Dofus */
.dofus-stats-card {
    background: rgba(var(--panel), 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--tint), 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(var(--shade), 0.4), inset 0 1px 1px rgba(var(--tint), 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dofus-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-green), var(--color-purple));
}

.dofus-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(var(--tint), 0.08);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.dofus-stats-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dofus-stats-title i {
    color: var(--color-green);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.dofus-stats-title h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--on-surface);
    margin: 0;
}

.dofus-stats-subtitle {
    font-size: 0.85rem;
    color: rgba(var(--tint), 0.4);
    font-weight: 300;
}

.dofus-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.dofus-stat-item {
    background: rgba(var(--tint), 0.03);
    border: 1px solid rgba(var(--tint), 0.04);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.dofus-stat-item:hover {
    background: rgba(var(--tint), 0.06);
    border-color: rgba(var(--tint), 0.1);
    transform: translateY(-2px);
}

.dofus-stat-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: transparent !important;
}

.dofus-stat-icon.pa-pm {
    color: #60a5fa;
}

.dofus-stat-icon.stats {
    color: var(--green-light);
}

.dofus-stat-icon.vitality {
    color: var(--red-light);
}

.dofus-stat-icon.wisdom {
    color: var(--gold-light);
}

.dofus-stat-icon.damages {
    color: var(--purple-light);
}

.dofus-stat-icon.crit {
    color: #f472b6;
}

.dofus-stat-icon.res {
    color: #9ca3af;
}

.dofus-stat-info {
    display: flex;
    flex-direction: column;
}

.dofus-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--on-surface);
}

.dofus-stat-name {
    font-size: 0.75rem;
    color: rgba(var(--tint), 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dofus-stats-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 0;
    color: rgba(var(--tint), 0.35);
    font-style: italic;
    font-size: 0.95rem;
}

@keyframes pulse-orange-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.1);
        border-color: rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
        border-color: rgba(245, 158, 11, 0.5);
    }
}

/* Style de pied de page */
.app-footer {
    text-align: center;
    padding: 30px 20px 15px;
    margin-top: 40px;
    border-top: 1px solid rgba(var(--tint), 0.05);
    font-family: 'Outfit', sans-serif;
}

.app-footer p {
    color: rgba(var(--tint), 0.35);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.app-footer strong {
    color: rgba(var(--tint), 0.65);
    font-weight: 600;
}

.app-footer-heart {
    color: var(--boss-red);
    font-size: 0.8rem;
    animation: heart-beat 1.3s infinite ease-in-out;
}

@keyframes heart-beat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.22);
    }
}

/* Bannière d'actions rapides de prestige */
.prestige-actions-banner {
    background: rgba(var(--panel), 0.4);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(var(--shade), 0.2);
    backdrop-filter: blur(10px);
}

.prestige-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.prestige-banner-title {
    font-family: 'Outfit', sans-serif;
    color: rgba(var(--tint), 0.85);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prestige-banner-title i {
    color: var(--purple-main);
    animation: flash-purple 1.5s infinite ease-in-out;
}

@keyframes flash-purple {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.prestige-banner-buttons {
    display: flex;
    gap: 10px;
}

.prestige-banner-buttons .btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
}

/* =========================================================================
   AUTH MODAL & PREMIUM STYLES
   ========================================================================= */

.auth-modal-content {
    max-width: 460px;
    background: rgba(var(--panel), 0.95);
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 30px 70px -15px rgba(var(--shade), 0.9), 0 0 50px rgba(168, 85, 247, 0.35);
}

.btn-google-modal {
    width: 100%;
    justify-content: center;
    background: rgba(var(--tint), 0.05);
    color: var(--on-surface);
    border: 1px solid rgba(var(--tint), 0.1);
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    border-radius: 14px;
    margin-bottom: 0.5rem;
}

.btn-google-modal:hover {
    background: rgba(var(--tint), 0.12);
    border-color: rgba(var(--tint), 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--tint), 0.1);
}

.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-separator:not(:empty)::before {
    margin-right: 1rem;
}

.auth-separator:not(:empty)::after {
    margin-left: 1rem;
}

.auth-tabs {
    display: flex;
    background: rgba(var(--shade), 0.35);
    padding: 0.35rem;
    border-radius: 14px;
    border: 1px solid rgba(var(--tint), 0.06);
    margin-bottom: 2rem;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-body);
}

.auth-tab-btn:hover {
    color: var(--on-surface);
}

.auth-tab-btn.active {
    background: linear-gradient(135deg, var(--purple-main), #7e22ce);
    color: var(--on-surface);
    box-shadow: 0 4px 15px var(--purple-glow);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 14px;
    margin-top: 1rem;
}

.auth-error-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--red-light);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-error-box.hidden {
    display: none;
}

#pw-strength-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: color 0.3s;
}

#pw-strength-hint.valid {
    color: var(--green-light);
}

#pw-strength-hint.invalid {
    color: var(--red-light);
}

/* =========================================================================
   SYSTÈME GROUPE DE FARM
   ========================================================================= */

.btn-group-header {
    background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.1));
    color: var(--green-light);
    border: 1px solid rgba(16,185,129,0.4);
    font-weight: 700;
    transition: all 0.2s;
}
.btn-group-header:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.35), rgba(16,185,129,0.2));
    border-color: var(--green-light);
    box-shadow: 0 0 20px rgba(16,185,129,0.3);
    transform: translateY(-2px);
}
.btn-group-header.in-group {
    background: linear-gradient(135deg, var(--green-main), var(--green-deep));
    color: var(--on-surface);
    border-color: var(--green-light);
    box-shadow: 0 4px 15px rgba(16,185,129,0.4);
}
.btn-group-header.group-mode-active {
    background: linear-gradient(135deg, var(--gold), #d97706);
    color: var(--on-surface);
    border-color: var(--gold-light);
    box-shadow: 0 4px 15px rgba(245,158,11,0.4);
}

.group-modal-content { max-width: 520px; }

/* Sections create/join */
.group-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.group-separator-or {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 1.5rem 0;
    position: relative;
}
.group-separator-or::before, .group-separator-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--border-color);
}
.group-separator-or::before { left: 0; }
.group-separator-or::after { right: 0; }

/* Panel groupe actif */
.group-active-panel { display: flex; flex-direction: column; gap: 1.25rem; }

.group-code-card {
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.group-code-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 0 0 auto;
}
.group-code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--green-light);
    letter-spacing: 4px;
    flex: 1;
    text-align: center;
}
.group-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.group-info-row strong { color: var(--on-surface); }

.group-members-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: rgba(var(--shade), 0.2);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.75rem;
}
.group-member-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: rgba(var(--tint), 0.02);
    border: 1px solid rgba(var(--tint), 0.05);
}
.group-member-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--purple-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.group-member-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.group-member-name { font-weight: 700; font-size: 0.95rem; }
.group-creator-badge {
    background: rgba(245,158,11,0.15);
    color: var(--gold-light);
    border: 1px solid rgba(245,158,11,0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}
.group-you-badge {
    background: rgba(168,85,247,0.15);
    color: var(--purple-light);
    border: 1px solid rgba(168,85,247,0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Toggle groupe */
.group-mode-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(var(--tint), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.9rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.group-mode-toggle {
    width: 48px; height: 26px;
    background: rgba(var(--tint), 0.1);
    border: 1px solid rgba(var(--tint), 0.15);
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    transition: all 0.25s;
}
.group-mode-toggle.active {
    background: linear-gradient(135deg, var(--green-main), var(--green-deep));
    border-color: var(--green-light);
    box-shadow: 0 0 12px rgba(16,185,129,0.4);
}
.toggle-knob {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: white;
    border-radius: 50%;
    transition: left 0.25s cubic-bezier(0.16,1,0.3,1);
    box-shadow: 0 2px 6px rgba(var(--shade), 0.4);
}
.group-mode-toggle.active .toggle-knob { left: 25px; }

.group-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Bandeau mode groupe */
.group-mode-banner {
    background: linear-gradient(90deg, rgba(245,158,11,0.12), rgba(245,158,11,0.05));
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 14px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}
.group-mode-banner-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--gold-light);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Barre groupe sur les ressources */
.group-res-breakdown {
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 10px;
    font-size: 0.82rem;
    color: rgba(var(--tint), 0.7);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.group-res-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.group-res-breakdown-row .member-name { color: var(--text-muted); font-weight: 600; }
.group-res-breakdown-row .member-qty { font-weight: 800; color: var(--gold-light); }
.group-res-total-row {
    border-top: 1px solid rgba(245,158,11,0.2);
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    font-weight: 800;
    color: var(--on-surface);
    display: flex;
    justify-content: space-between;
}
.group-res-total-pct { color: var(--green-light); }

/* =========================================================================
   RESPONSIVE MOBILE ET TABLETTE PREMIUM
   ========================================================================= */

@media (max-width: 768px) {
    .app-container {
        padding: 1.25rem 1rem;
    }
    .prestige-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .prestige-tabs::-webkit-scrollbar {
        display: none; /* Safari et Chrome */
    }
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
        margin-bottom: 1.75rem;
    }
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 1rem 0.75rem;
    }
    .site-main-logo {
        max-height: 56px;
    }
    .stats-overview {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .stat-card {
        padding: 1rem;
        gap: 1rem;
    }
    .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    .stat-icon svg {
        width: 22px;
        height: 22px;
    }
    .items-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .item-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    .dofus-stats-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    .dofus-stats-header {
        margin-bottom: 16px;
    }
    .dofus-stats-title h3 {
        font-size: 1.1rem;
    }
    .dofus-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .dofus-stat-item {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 10px;
    }
    .dofus-stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
        border-radius: 6px;
    }
    .dofus-stat-value {
        font-size: 1rem;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .search-box {
        max-width: 100%;
    }
    .filter-options {
        justify-content: space-between;
        gap: 0.5rem;
    }
    .filter-tag {
        flex: 1;
        text-align: center;
        padding: 0.55rem;
        font-size: 0.8rem;
    }
    .dofus-filters {
        width: 100%;
        justify-content: flex-start;
        padding: 0.4rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .dofus-filters::-webkit-scrollbar {
        display: none;
    }
    .dofus-tag {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    
    /* MODALS RESPONSIVES */
    .modal {
        padding: 0.5rem;
    }
    .modal-content {
        border-radius: 20px;
    }
    .modal-header {
        padding: 1.25rem 1.5rem;
    }
    .modal-title-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .item-slot-big {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }
    .modal-body {
        padding: 1.25rem 1.5rem;
    }
    .modal-footer {
        padding: 1.25rem 1.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .modal-footer button {
        width: 100%;
        justify-content: center;
    }
    
    /* LIGNES DE COMPOSANTS DANS LES MODALS */
    .resource-item-row { border-radius: 11px; }
    .res-inner {
        flex-direction: column;
        gap: 0.55rem;
    }
    .res-row-left { width: 100%; }
    .res-row-right {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.4rem;
        border-top: 1px solid rgba(var(--tint), 0.05);
        gap: 0.45rem;
        flex-wrap: wrap;
    }
    
    /* AJOUT D'ITEM ET FORMULAIRE VERTICAL */
    .res-edit-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.85rem;
        border-radius: 12px;
    }
    .res-input-req {
        width: 100% !important;
    }
    .checkbox-group {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
    }
}

/* Style des images pour les statistiques des Dofus */
.dofus-stat-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(var(--shade), 0.3));
    transition: transform 0.2s ease;
}
.dofus-stat-item:hover .dofus-stat-img {
    transform: scale(1.15);
}

/* =========================================================
   CALCULATEUR DE DROP (js/prospection.js)
   Des tuiles qu'on clique plutôt qu'un formulaire, le multiplicateur en
   grand, et une tuile par carte avec le nombre de combats.
   ========================================================= */
.prosp-calculator {
    background: var(--surf);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    padding: 1rem 1.1rem 1.1rem;
    margin-bottom: 1.5rem;
}

.prosp-calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}
.prosp-calc-titre {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--cond);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--bright);
}
.prosp-calc-titre i { color: var(--acc); }

.prosp-mult {
    flex: none;
    white-space: nowrap;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--acc) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent);
}
.prosp-mult-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-c);
}
.prosp-mult-val {
    font-family: var(--cond);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--acc-hi);
    font-variant-numeric: tabular-nums;
}

/* --- Réglages : quatre tuiles ------------------------------------------ */
.prosp-reglages {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.6fr;
    gap: 0.6rem;
}
@media (max-width: 760px) {
    .prosp-reglages { grid-template-columns: 1fr 1fr; }
    .prosp-tuile-diff { grid-column: 1 / -1; }
}

.prosp-tuile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.6rem 0.7rem;
    background: var(--cell);
    border: 1px solid var(--line-2);
    border-radius: 10px;
}
.prosp-tuile-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--muted-c);
    white-space: nowrap;
}
.prosp-tuile-label i { margin-right: 0.25rem; opacity: 0.85; }

.prosp-pp { display: flex; align-items: center; gap: 0.3rem; }
.prosp-pas {
    flex: none;
    width: 28px;
    height: 30px;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: var(--btn);
    color: var(--bright);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.prosp-pas:hover { border-color: var(--acc); }

.prosp-input {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0 0.5rem;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: var(--surf);
    color: var(--bright);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}
.prosp-input::-webkit-inner-spin-button,
.prosp-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.prosp-input:focus { outline: none; border-color: var(--acc); }

/* Potions : toute la tuile est le bouton. */
.prosp-pilule { cursor: pointer; user-select: none; transition: border-color 0.15s, background 0.15s; }
.prosp-pilule input { position: absolute; opacity: 0; pointer-events: none; }
.prosp-pilule-val {
    align-self: flex-start;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--btn);
    color: var(--muted-c);
    font-weight: 800;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}
.prosp-pilule:hover { border-color: color-mix(in srgb, var(--acc) 55%, transparent); }
.prosp-pilule:has(input:checked) {
    border-color: var(--acc);
    background: color-mix(in srgb, var(--acc) 12%, var(--cell));
}
.prosp-pilule:has(input:checked) .prosp-pilule-val { background: var(--acc); color: var(--on-acc); }
.prosp-pilule:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }

.prosp-diff-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 3px;
    border-radius: 8px;
    background: var(--surf);
}
.prosp-diff-btn {
    padding: 0.3rem 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-c);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.prosp-diff-btn:hover { color: var(--bright); }
.prosp-diff-btn.active { background: var(--acc); color: var(--on-acc); }

/* --- Une tuile par carte ------------------------------------------------ */
.prosp-cartes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.6rem;
    margin-top: 0.85rem;
}
.prosp-cartes:empty { display: none; }
.prosp-carte {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-areas: "ico nom" "ico combats" "ico taux";
    column-gap: 0.6rem;
    align-items: center;
    padding: 0.6rem 0.7rem;
    background: var(--cell);
    border: 1px solid var(--line-2);
    border-radius: 10px;
}
.prosp-carte-ico { grid-area: ico; display: flex; align-items: center; justify-content: center; }
.prosp-carte-ico img { width: 34px; height: 34px; object-fit: contain; }
.prosp-carte-ico i { color: var(--muted-c); }
.prosp-carte-nom {
    grid-area: nom;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-c);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prosp-carte-combats {
    grid-area: combats;
    font-family: var(--cond);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--bright);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.prosp-carte-combats small { font-size: 0.72rem; font-weight: 600; color: var(--muted-c); }
.prosp-carte-taux { grid-area: taux; font-size: 0.7rem; color: var(--acc-hi); font-weight: 600; }
.prosp-carte.obtenue { opacity: 0.6; }
.prosp-carte-ok { grid-area: combats; font-size: 0.8rem; font-weight: 700; color: #4ade80; }

/* --- Autre objet (repliable) -------------------------------------------- */
.prosp-custom-block { margin-top: 0.85rem; }
.prosp-custom-block > summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-c);
    list-style: none;
}
.prosp-custom-block > summary::-webkit-details-marker { display: none; }
.prosp-custom-block > summary::before { content: "▸ "; }
.prosp-custom-block[open] > summary::before { content: "▾ "; }
.prosp-custom-block > summary:hover { color: var(--bright); }
.prosp-custom-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.prosp-custom-results {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.6rem;
}
.prosp-custom-res { display: flex; flex-direction: column; gap: 2px; }
.prosp-custom-res-label { font-size: 0.7rem; color: var(--muted-c); font-weight: 600; }
.prosp-custom-res-value { font-size: 1.05rem; font-weight: 800; color: var(--bright); }
.prosp-ppmin-ok { color: #4ade80; }
.hidden.prosp-custom-results { display: none; }

/* =====================================================================
   AMÉLIORATIONS CSS v2 — Scrollbar, animations, depth, polish
   ===================================================================== */

/* SCROLLBAR CUSTOM */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: rgba(var(--shade), 0.2);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.35);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.62);
}
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.35) rgba(var(--shade), 0.2);
}

/* BACKGROUND GLOWS ANIMÉS — mouvement lent */
/* Translation seule, sans `scale` : mettre à l'échelle un élément flouté à
   130 px force une nouvelle trame à chaque image, alors qu'un simple
   déplacement reste une opération de compositeur. Sur une tache floue de cette
   taille, les 8 % d'échelle ne se voyaient de toute façon pas. */
@keyframes glow-drift-purple {
    0%   { transform: translate(0,     0);    }
    50%  { transform: translate(45px, -40px); }
    100% { transform: translate(-25px,  22px); }
}
@keyframes glow-drift-green {
    0%   { transform: translate(0,     0);    }
    50%  { transform: translate(-40px,  28px); }
    100% { transform: translate(22px,  -18px); }
}
.bg-glow-purple { animation: glow-drift-purple 20s ease-in-out infinite alternate; }
.bg-glow-green  { animation: glow-drift-green  25s ease-in-out infinite alternate; }

/* SHIMMER SUR PROGRESS BARS */
@keyframes shimmer-slide {
    0%   { transform: translateX(-160%); }
    100% { transform: translateX(260%);  }
}
.progress-bar {
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--tint), 0.28), transparent);
    animation: shimmer-slide 2.8s ease-in-out infinite;
    pointer-events: none;
}

/* STAT CARDS — Colored top border per type */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 20px 20px 0 0;
    opacity: 0.55;
    transition: opacity 0.3s;
    z-index: 1;
}
.stat-card:hover::before { opacity: 1; }

.stat-card:has(.purple-glow)::before {
    background: linear-gradient(90deg, var(--purple-main), var(--purple-light), transparent);
}
.stat-card:has(.green-glow)::before {
    background: linear-gradient(90deg, var(--green-main), var(--green-light), transparent);
}
.stat-card:has(.red-glow)::before {
    background: linear-gradient(90deg, var(--boss-red), var(--red-light), transparent);
}
.stat-card:has(.gold-glow)::before {
    background: linear-gradient(90deg, var(--gold), var(--gold-light), transparent);
}

/* STAT CARDS — Gradient text per type */
.stat-card:has(.purple-glow) .stat-info h3 {
    background: linear-gradient(135deg, var(--purple-pale), var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card:has(.green-glow) .stat-info h3 {
    background: linear-gradient(135deg, #a7f3d0, var(--green-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card:has(.red-glow) .stat-info h3 {
    background: linear-gradient(135deg, var(--red-pale), var(--red-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card:has(.gold-glow) .stat-info h3 {
    background: linear-gradient(135deg, var(--gold-light), #fef3c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* STAT CARDS — Hover glow per type */
.stat-card:has(.purple-glow):hover {
    box-shadow: 0 14px 36px rgba(var(--shade), 0.45), 0 0 28px rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.22);
}
.stat-card:has(.green-glow):hover {
    box-shadow: 0 14px 36px rgba(var(--shade), 0.45), 0 0 28px rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.22);
}
.stat-card:has(.red-glow):hover {
    box-shadow: 0 14px 36px rgba(var(--shade), 0.45), 0 0 28px rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.22);
}
.stat-card:has(.gold-glow):hover {
    box-shadow: 0 14px 36px rgba(var(--shade), 0.45), 0 0 28px rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.22);
}

/* STAT CARDS — Appearance animation */
@keyframes stat-appear {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0);    }
}
.stats-overview .stat-card:nth-child(1) { animation: stat-appear 0.4s   0ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.stats-overview .stat-card:nth-child(2) { animation: stat-appear 0.4s  75ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.stats-overview .stat-card:nth-child(3) { animation: stat-appear 0.4s 150ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.stats-overview .stat-card:nth-child(4) { animation: stat-appear 0.4s 225ms cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ITEM CARDS — Micro-animation d'apparition échelonnée */
@keyframes item-appear {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0);    }
}
.item-card {
    animation: item-appear 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.item-card:nth-child(1)    { animation-delay:   0ms; }
.item-card:nth-child(2)    { animation-delay:  55ms; }
.item-card:nth-child(3)    { animation-delay: 110ms; }
.item-card:nth-child(4)    { animation-delay: 165ms; }
.item-card:nth-child(5)    { animation-delay: 220ms; }
.item-card:nth-child(6)    { animation-delay: 275ms; }
.item-card:nth-child(7)    { animation-delay: 330ms; }
.item-card:nth-child(8)    { animation-delay: 385ms; }
.item-card:nth-child(9)    { animation-delay: 440ms; }
.item-card:nth-child(n+10) { animation-delay: 480ms; }

/* ITEM CARDS — Enhanced hover glow */
.item-card:hover {
    box-shadow:
        0 22px 44px rgba(var(--shade), 0.55),
        0 0 30px rgba(168, 85, 247, 0.32),
        0 0 60px rgba(168, 85, 247, 0.10);
}

/* TAB BTN ACTIVE — glow renforcé */
.tab-btn.active {
    box-shadow:
        0 4px 18px rgba(168, 85, 247, 0.48),
        inset 0 1px 0 rgba(var(--tint), 0.2),
        0 0 0 1px rgba(168, 85, 247, 0.28);
}

/* ===== RELIQUES ===== */
.reliques-container {
    padding: 1.5rem 2rem;
}
.reliques-page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.reliques-page-header > i {
    font-size: 2rem;
    color: var(--gold);
}
.reliques-page-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}
.reliques-page-header p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0.2rem 0 0;
}
.reliques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
    align-items: start;
}

/* Group card */
.relique-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--rg-color, var(--purple-main));
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.relique-group:hover {
    box-shadow: 0 8px 24px rgba(var(--shade), 0.35), 0 0 0 1px rgba(var(--tint), 0.04);
}
.relique-group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    background: rgba(var(--tint), 0.03);
    border-bottom: 1px solid var(--border-color);
}
.relique-stat-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.relique-group-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--rg-color, var(--text-primary));
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.relique-group-badge {
    background: rgba(var(--tint), 0.06);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Item list */
.relique-list {
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.relique-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
    transition: background 0.15s;
}
.relique-item:hover {
    background: rgba(var(--tint), 0.04);
}

/* --- Possession des reliques (partagée avec le Book) --- */
.relique-collection-summary {
    margin: 0 0 0.9rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.22);
    font-size: 0.85rem;
    color: var(--text-soft);
}
.relique-collection-summary strong { color: var(--on-surface); }
.relique-collection-summary i { color: var(--purple-soft); margin-right: 4px; }

.relique-item.owned {
    background: rgba(16, 185, 129, 0.08);
    box-shadow: inset 2px 0 0 var(--green-main);
}
.relique-own {
    margin-left: auto;
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}
.ro-lvl, .ro-toggle {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(var(--tint), 0.1);
    background: rgba(var(--tint), 0.04);
    color: #8896b3;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    display: inline-grid;
    place-items: center;
}
.ro-lvl:hover, .ro-toggle:hover {
    color: var(--on-surface);
    border-color: var(--green-main);
    background: rgba(16, 185, 129, 0.18);
}
/* Palier atteint : les cases inférieures restent allumées en plus discret. */
.ro-lvl.below { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.ro-lvl.on, .ro-toggle.on {
    background: linear-gradient(135deg, var(--green-main), var(--green-deep));
    border-color: var(--green-light);
    color: var(--on-surface);
}
.relique-portrait {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
}
.relique-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.relique-portrait-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rg-color, var(--text-muted));
    font-size: 1rem;
}
.relique-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}
.relique-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.relique-val {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--rg-color, var(--purple-main));
    font-family: var(--font-heading);
}

@media (max-width: 768px) {
    .reliques-container { padding: 1rem; }
    .reliques-grid { grid-template-columns: 1fr; }
}

/* ===== RELIQUES FILTER ===== */
.relique-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}
.relique-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: rgba(var(--tint), 0.04);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.relique-filter-btn:hover {
    background: rgba(var(--tint), 0.08);
    color: var(--text-primary);
}
.relique-filter-btn.active {
    background: rgba(var(--rbtn-color, 168 85 247) / 0.18);
    border-color: var(--rbtn-color, var(--purple-main));
    color: var(--rbtn-color, var(--purple-main));
}
.relique-filter-btn:first-child.active {
    background: rgba(168,85,247,0.18);
    border-color: var(--purple-main);
    color: var(--purple-main);
}

/* ===== PERSONNAGES ===== */
.personnages-container { padding: 1.5rem 2rem; }

.perso-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.perso-list-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}
.perso-list-header p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0.2rem 0 0;
}

.perso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.perso-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.perso-empty i { font-size: 2.5rem; margin-bottom: 1rem; display: block; opacity: 0.4; }

/* Perso Card */
.perso-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.perso-card:hover {
    box-shadow: 0 8px 24px rgba(var(--shade), 0.35), 0 0 20px rgba(168,85,247,0.12);
    border-color: rgba(168,85,247,0.25);
    transform: translateY(-2px);
}
.perso-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.perso-avatar {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--purple-main);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.perso-card-info { flex: 1; min-width: 0; }
.perso-card-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.perso-meta { font-size: 0.72rem; color: var(--text-muted); }
.perso-overall-badge {
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--purple-light);
    white-space: nowrap;
}
.perso-progress-bar-outer {
    height: 5px;
    background: rgba(var(--tint), 0.06);
    border-radius: 999px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.perso-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--purple-main), var(--purple-light));
    border-radius: 999px;
    transition: width 0.4s;
}
.perso-card-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Detail view */
.perso-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.perso-detail-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.perso-avatar-large {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--purple-main);
    font-size: 1.4rem;
}
.perso-detail-title h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
}

/* Progress bars */
.perso-detail-progress {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.perso-prog-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.perso-prog-item:last-of-type { color: var(--text-primary); font-weight: 600; }
.perso-prog-bar {
    height: 6px;
    background: rgba(var(--tint), 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.perso-prog-bar > div {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s;
}
.perso-overall-row {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

/* Stats recap */
.perso-stats-recap {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.perso-stats-recap h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.9rem;
}
.perso-stats-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.perso-stat-chip {
    background: color-mix(in srgb, var(--chip-color, var(--purple-main)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--chip-color, var(--purple-main)) 35%, transparent);
    border-radius: 10px;
    padding: 0.35rem 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}
.perso-stat-val {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--chip-color, var(--purple-main));
    font-family: var(--font-heading);
}
.perso-stat-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 0.1rem;
}

/* Collapsible sections */
.perso-detail-sections { display: flex; flex-direction: column; gap: 0.75rem; }
.perso-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}
.perso-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.perso-section-header:hover { background: rgba(var(--tint), 0.03); }
.perso-section-header span { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); margin-right: 0.4rem; }
.perso-section-header .fa-chevron-down { color: var(--text-muted); font-size: 0.72rem; transition: transform 0.2s; }
.perso-section.open .fa-chevron-down { transform: rotate(180deg); }
.perso-section-body { display: none; padding: 0.5rem 0.75rem 0.75rem; border-top: 1px solid var(--border-color); }
.perso-section.open .perso-section-body { display: block; }

/* Track items (dofus/reliques/items) */
.perso-track-grid { display: flex; flex-direction: column; gap: 0.2rem; }
.perso-track-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s;
    opacity: 0.55;
}
.perso-track-item:hover { background: rgba(var(--tint), 0.04); opacity: 0.8; }
.perso-track-item.obtained { opacity: 1; }
.perso-track-img {
    width: 34px; height: 34px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.06);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.perso-track-img img { width: 100%; height: 100%; object-fit: cover; }
.perso-track-name {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.perso-track-check {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.perso-track-item.obtained .perso-track-check { color: var(--green-main); }
.perso-track-item.obtained .perso-track-name { color: var(--text-primary); }

/* Reliques groups in detail */
.perso-reliq-group { margin-bottom: 0.75rem; }
.perso-reliq-label {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.2rem;
}

/* Reliques — sélecteur de palier par relique */
.perso-reliq-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 9px;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}
.perso-reliq-row.owned { opacity: 1; }
.perso-reliq-row:hover { background: rgba(var(--tint), 0.03); }
.perso-reliq-portrait { width: 32px; height: 32px; }
.perso-reliq-rname {
    flex: 1;
    min-width: 70px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.perso-reliq-levels {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.perso-rlvl {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 2px 5px;
    border: 1px solid rgba(var(--tint), 0.1);
    border-radius: 6px;
    background: rgba(var(--tint), 0.03);
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.15;
    transition: all 0.12s;
}
.perso-rlvl:hover { border-color: var(--rlvl-color, var(--purple-main)); color: var(--text-primary); }
.perso-rlvl-n { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.3px; opacity: 0.75; }
.perso-rlvl-v { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.perso-rlvl.active {
    background: rgba(168,85,247,0.22);
    background: color-mix(in srgb, var(--rlvl-color, var(--purple-main)) 22%, transparent);
    border-color: var(--rlvl-color, var(--purple-main));
    color: var(--on-surface);
    box-shadow: 0 0 0 1px var(--rlvl-color, var(--purple-main)) inset;
}
.perso-rlvl.none {
    min-width: 26px;
    font-size: 0.85rem;
    color: var(--red-light);
    border-color: rgba(248,113,113,0.3);
}
.perso-rlvl.none.active {
    background: rgba(248,113,113,0.18);
    border-color: var(--red-light);
    color: var(--red-pale);
    box-shadow: none;
}
.perso-rlvl.perso-rlvl-own { min-width: 32px; }
.perso-rlvl.perso-rlvl-own .perso-rlvl-n { font-size: 0.9rem; opacity: 1; }
.perso-rlvl.perso-rlvl-own.active {
    background: rgba(74,222,128,0.18);
    border-color: #4ade80;
    color: #86efac;
    box-shadow: 0 0 0 1px #4ade80 inset;
}
.perso-prest-group { margin-bottom: 0.75rem; }
.perso-prest-label {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--purple-light);
    text-transform: uppercase;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.2rem;
}
.perso-breed-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
    padding: 4px;
    background: rgba(var(--tint), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.breed-pick-item {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--tint), 0.05);
    transition: border-color 0.15s, background 0.15s;
}
.breed-pick-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: brightness(1.9) saturate(1.2);
}
.breed-pick-item:hover {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.4);
}
.breed-pick-item.selected {
    background: rgba(168,85,247,0.2);
    border-color: var(--purple-main);
}
.perso-avatar img, .perso-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
@media (max-width: 768px) {
    .personnages-container { padding: 1rem; }
    .perso-list-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .perso-grid { grid-template-columns: 1fr; }
    .perso-prog-item { grid-template-columns: 60px 1fr 60px; }
}

/* Custom Tooltip */
.custom-tooltip {
    position: fixed;
    z-index: 999999;
    width: 320px;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(var(--shade), 0.7);
    color: var(--text-soft);
    pointer-events: none;
    transition: opacity 0.15s ease;
    opacity: 0;
    visibility: hidden;
}
.custom-tooltip.visible {
    opacity: 1;
    visibility: visible;
}
.custom-tooltip .tt-head {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}
.custom-tooltip .tt-head img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(var(--shade), 0.4));
}
.custom-tooltip .tt-titles h4 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.1rem;
}
.custom-tooltip .tt-sub {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.custom-tooltip .tt-sub .tag {
    background: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid #334155;
}
.custom-tooltip .tt-effects {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}
.custom-tooltip .tt-effects li {
    padding: 2px 0;
    color: var(--green-main);
}
.custom-tooltip .tt-effects li.negative,
.custom-tooltip .tt-effects li .negative {
    color: var(--boss-red);
}
/* Niveau et prestige modifiables directement sur la fiche du personnage. */
.perso-meta-edit { display: inline-flex; align-items: center; gap: 6px; }
.perso-meta-edit input,
.perso-meta-edit select {
    background: rgba(var(--shade), .3);
    border: 1px solid var(--border, rgba(var(--tint), .12));
    border-radius: 6px;
    color: inherit;
    font: inherit;
    font-weight: 700;
    padding: 1px 4px;
    cursor: pointer;
}
.perso-meta-edit input { width: 58px; }

/* Recherche de relique : 143 entrées réparties en groupes, l'œil ne suffit pas. */
.relique-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: 10px;
    background: rgba(var(--tint), .04);
    border: 1px solid var(--border, rgba(var(--tint), .12));
}
.relique-search-row i { color: var(--text-muted, var(--text-muted)); font-size: 13px; }
.relique-search-row input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: none;
    color: inherit;
    font: inherit;
    font-size: 14px;
}
/* Palier possédé, à côté de la valeur qu'il donne réellement. */
.relique-lvl-tag {
    font-style: normal;
    font-size: 10px;
    letter-spacing: .4px;
    text-transform: uppercase;
    opacity: .7;
    margin-left: 4px;
}

/* Cumul des Dofus : possédés (tout ce qu'on a) ou portés (équipés dans le Book). */
.dofus-scope-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dofus-scope-toggle { display: inline-flex; gap: 4px; }
.dofus-scope-btn {
    background: rgba(var(--tint), .04);
    border: 1px solid var(--border, rgba(var(--tint), .12));
    border-radius: 999px;
    color: var(--text-muted, var(--text-muted));
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    cursor: pointer;
    transition: all .14s;
}
.dofus-scope-btn:hover { color: var(--on-surface); }
.dofus-scope-btn.active {
    color: var(--on-surface);
    border-color: var(--purple-main, var(--purple-deep));
    background: rgba(139, 92, 246, .18);
}

/* Jetons gagnés par donjon, réglable dans l'en-tête de colonne. */
#jetons-par-donjon {
    width: 46px;
    margin-left: 6px;
    background: rgba(var(--shade), .3);
    border: 1px solid var(--border, rgba(var(--tint), .12));
    border-radius: 6px;
    color: inherit;
    font: inherit;
    font-size: 12px;
    padding: 1px 4px;
}

/* Jetons ramassés en passant sur un boss (rendement réglé par le joueur). */
.farm-jetons {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gold, #fcd34d);
    white-space: nowrap;
    margin-right: 10px;
}
.farm-jetons i { font-size: 11px; opacity: .85; }


/* Halos d'ambiance et lueurs : très atténués en clair, où ils viraient au sale. */
html[data-theme="light"] { --ambiance: 0.55; }
html[data-theme="light"] .bg-glow { opacity: .35; }

/* Bascule sombre / clair, à côté du widget de connexion. */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--tint), .06);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .16s;
    flex: none;
}
.theme-toggle:hover {
    color: var(--gold-light);
    border-color: var(--gold);
    background: rgba(var(--tint), .12);
}

/* Texte blanc sur aplat de couleur : il doit RESTER blanc en thème clair, car
   le fond, lui, garde sa couleur vive. L'audit de contraste a servi de liste. */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-success,
html[data-theme="light"] .btn-danger,
html[data-theme="light"] .btn.btn-success,
html[data-theme="light"] .btn.btn-primary,
html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .nav-item.active *,
html[data-theme="light"] .filter-tag.active,
html[data-theme="light"] .dofus-tag.active,
html[data-theme="light"] .btn-subfilter.active,
html[data-theme="light"] .relique-filter-btn.active,
html[data-theme="light"] .auth-btn-login,
html[data-theme="light"] .step-num,
html[data-theme="light"] .tier-pill,
html[data-theme="light"] .dofus-scope-btn.active {
    color: var(--on-accent);
}

/* Les couleurs de groupe des reliques sont posées en style inline depuis les
   données (--rg-color) : impossible de les redéfinir par thème. On les assombrit
   donc à l'affichage, ce qui garde le code couleur tout en le rendant lisible
   sur fond clair. Même chose pour les quelques pastilles colorées du primo. */
html[data-theme="light"] .relique-val,
html[data-theme="light"] .relique-group-name {
    color: color-mix(in srgb, var(--rg-color, var(--purple-main)) 55%, #000);
}
html[data-theme="light"] .jeton-name-pill,
html[data-theme="light"] .stat-missing,
html[data-theme="light"] .casse-restant-val,
html[data-theme="light"] .stat-dj,
html[data-theme="light"] .primo-badge-testing {
    color: color-mix(in srgb, currentColor 60%, #000);
}
/* Les pastilles de fond du primo viraient au gris sale : on les éclaircit. */
html[data-theme="light"] .stat-missing,
html[data-theme="light"] .casse-restant-val,
html[data-theme="light"] .stat-dj {
    background: rgba(var(--tint), .05);
}

/* Liens laissés au style par défaut du navigateur : bleu vif, illisible sur les
   deux thèmes. */
a { color: var(--purple-light); }
a:hover { color: var(--purple-main); }

/* ── BESTIAIRE ────────────────────────────────────────────────────────────
   « Contre qui je me bats, et avec quel élément ? » L'élément mis en avant
   est celui où la résistance du monstre est la plus basse. */
.bestiaire-container { display: flex; flex-direction: column; gap: 14px; }
.best-head-bar h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.best-head-bar h2 i { color: var(--purple-light); }
.best-head-bar p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

.best-filters { display: flex; flex-direction: column; gap: 8px; }
.best-search {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 13px; border-radius: 10px;
    background: rgba(var(--tint), .04); border: 1px solid var(--border-color);
}
.best-search i { color: var(--text-muted); font-size: 13px; }
.best-search input {
    flex: 1; min-width: 0; background: none; border: 0; outline: none;
    color: inherit; font: inherit; font-size: 14px;
}
.best-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.best-el {
    padding: 4px 12px; border-radius: 999px; cursor: pointer;
    background: rgba(var(--tint), .04); border: 1px solid var(--border-color);
    color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 600;
    transition: all .14s;
}
.best-el:hover { color: var(--text-main); border-color: var(--be, var(--purple-main)); }
.best-el.on {
    color: var(--on-accent); border-color: var(--be, var(--purple-main));
    background: color-mix(in srgb, var(--be, var(--purple-main)) 55%, transparent);
}

.best-list { display: flex; flex-direction: column; gap: 6px; }
.best-card {
    border-radius: 12px; overflow: hidden;
    background: var(--glass-bg); border: 1px solid var(--border-color);
}
.best-card.open { border-color: var(--purple-main); }
.best-head {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 9px 14px; background: none; border: 0; cursor: pointer;
    color: inherit; font: inherit; text-align: left;
}
.best-head:hover { background: rgba(var(--tint), .04); }
.best-lvl {
    min-width: 38px; text-align: center; font-variant-numeric: tabular-nums;
    font-weight: 800; font-size: 12.5px; color: var(--text-muted);
    background: rgba(var(--tint), .06); border-radius: 6px; padding: 2px 6px;
}
.best-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.best-tag {
    font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px;
    padding: 1px 7px; border-radius: 999px; color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.best-tag.boss { color: var(--gold-light); border-color: var(--gold); }
.best-weak {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    font-size: 12.5px; font-weight: 700; color: var(--be);
}
.best-chev { color: var(--text-muted); font-size: 12px; }

.best-body {
    display: flex; flex-direction: column; gap: 7px;
    padding: 4px 14px 12px; font-size: 13px;
    border-top: 1px solid rgba(var(--tint), .05);
}
.best-line { display: flex; gap: 12px; align-items: flex-start; }
.best-line.drops { flex-direction: column; gap: 5px; }
.best-lab {
    min-width: 92px; flex: none; color: var(--text-muted);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; padding-top: 2px;
}
.best-resline { display: flex; gap: 5px; flex-wrap: wrap; }
.best-res {
    font-size: 11.5px; font-variant-numeric: tabular-nums;
    padding: 1px 8px; border-radius: 999px;
    border: 1px solid var(--border-color); color: var(--text-muted);
}
.best-res.weak { color: var(--be); border-color: var(--be); font-weight: 700; }
.best-drops { display: flex; gap: 5px; flex-wrap: wrap; }
.best-drop {
    font-size: 12px; padding: 2px 9px; border-radius: 999px;
    background: rgba(var(--tint), .04); border: 1px solid var(--border-color);
}
.best-drop em { font-style: normal; color: var(--gold-light); font-weight: 700; margin-left: 4px; }
/* La ressource venue de « Où ça tombe » : celle qu'on cherchait, dans le lot. */
.best-drop.cible {
    border-color: var(--gold-light); color: var(--gold-light); font-weight: 700;
    background: rgba(250, 204, 21, .12); box-shadow: 0 0 0 1px rgba(250, 204, 21, .35);
}
.best-voir-tous { display: inline-flex; margin: 12px auto 0; }
.best-empty {
    padding: 40px; text-align: center; color: var(--text-muted);
    background: var(--glass-bg); border: 1px solid var(--border-color); border-radius: 14px;
}
.best-empty i { display: block; font-size: 24px; margin-bottom: 10px; opacity: .5; }

/* Élément conseillé sur un boss dans « Où farmer », lu dans le bestiaire. */
.farm-elem {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 700; color: var(--be);
    white-space: nowrap; margin-right: 10px;
}
.farm-elem i { font-size: 11px; opacity: .85; }

/* --- Ingrédients rattachés aux vrais objets du jeu -------------------------
   La ligne d'ingrédient portait le même cube gris pour tout le monde. Elle
   affiche maintenant l'icône de l'objet, et renvoie au bestiaire quand on
   sait qui le lâche. Voir js/ressources-liees.js. */

.res-row-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

/* L'icône de l'objet se suffit à elle-même : le fond coloré du pictogramme
   d'avant la salirait. On garde juste la teinte du cadre, qui dit boss,
   en cours ou terminé. */
.res-row-icon:has(.res-row-img) {
    background: rgba(var(--tint), 0.05);
}

.res-row-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.18rem;
}

.res-row-meta .zone-tag { margin-top: 0; }

.res-ou-tombe {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.28);
    border-radius: 6px;
    padding: 0.1rem 0.42rem;
    color: var(--purple-soft);
    font-family: inherit;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.res-ou-tombe i { font-size: 0.62rem; }

/* Meilleure source, à côté du bouton : le monstre et son taux par combat. */
.res-source {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.res-source em { font-style: normal; font-weight: 700; color: var(--gold-light); }
.res-source-plus { opacity: 0.75; }

.res-ou-tombe:hover {
    color: var(--purple-light);
    border-color: var(--purple-main);
    background: rgba(168, 85, 247, 0.1);
}

/* PA / PM / PO dans leur couleur du jeu, comme dans le Book (toneStat, js/utils.js). */
/* .st-ap / .st-mp / .st-po : voir refonte/tiers.css (dégradés partagés) */

/* Icône de carac devant une ligne de stat (infobulles, fiche du Dofus) :
   les mêmes que les cartes de stats cumulées. */
.ligne-stat-ico {
    width: 16px; height: 16px;
    object-fit: contain;
    vertical-align: -3px;
    margin-right: 6px;
    font-size: 13px;
    display: inline-block;
    text-align: center;
    color: var(--text-muted);
}
.custom-tooltip .tt-effects li.tt-ligne { display: flex; align-items: center; }
