/* ========================================
   WIKI SPIRAL-BUDDIES - STYLES SPECIFIQUES
   ======================================== */
/* ========================================
   WIKI SPIRAL-BUDDIES - STYLES SPECIFIQUES
   ======================================== */

/* --- LAYOUT WIKI --- */

/* --- LAYOUT WIKI --- */

/* ✅ FIX SCROLL POUR WIKI */
html.wiki-page {
    height: auto !important;       /* Vital: annule le blocage à 100% du style.css */
    min-height: 100%;
    overflow-y: auto !important;   /* Laisse le navigateur gérer le scroll naturellement */
}

body.wiki-page {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: visible !important;
    overflow-x: hidden;            /* Évite le scroll horizontal accidentel */
    position: relative;
}

.sb-wiki-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;             /* Compense la navbar fixed */
    background-color: var(--sb-void-dark);
    position: relative;
    box-sizing: border-box;        /* Assure que le padding n'explose pas la largeur */
}


/* --- SIDEBAR (MENU LATERAL) --- */
.sb-wiki-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--sb-slate-blue) 0%, rgba(22, 33, 46, 0.95) 100%);
    border-right: 2px solid rgba(255, 215, 0, 0.2);
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sb-wiki-sidebar-header {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    margin-bottom: 1.5rem;
}

.sb-wiki-sidebar-header h2 {
    font-size: 1.4rem;
    color: var(--sb-gold);
    margin: 0;
    text-align: center;
    font-family: 'Cinzel', serif;
}

.sb-wiki-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.sb-wiki-nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    color: var(--sb-text-main);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sb-wiki-nav-link:hover {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: var(--sb-gold);
    padding-left: 1.5rem;
    color: var(--sb-gold);
}

.sb-wiki-nav-link.active {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-left-color: var(--sb-gold);
    color: var(--sb-gold);
    font-weight: 700;
}

/* --- CONTENU PRINCIPAL --- */
.sb-wiki-content {
    flex: 1;
    padding: 3rem 2rem 3rem calc(280px + 2rem);
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.sb-wiki-hero {
    text-align: center;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.sb-wiki-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--sb-gold);
    font-family: 'Cinzel', serif;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.sb-wiki-subtitle {
    font-size: 1.2rem;
    color: var(--sb-text-muted);
    font-weight: 300;
}

/* --- SECTIONS --- */
.sb-wiki-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.sb-wiki-section.active {
    display: block;
}

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

.sb-wiki-section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.sb-wiki-section-header h2 {
    font-size: 2.2rem;
    color: var(--sb-gold);
    margin-bottom: 0.8rem;
    font-family: 'Cinzel', serif;
}

.sb-wiki-section-header p {
    font-size: 1.05rem;
    color: var(--sb-text-muted);
}

/* --- CARTES WIKI --- */
.sb-wiki-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.sb-wiki-card:hover {
    transform: translateY(-3px);
    border-color: rgba(88, 166, 24, 0.3);
    box-shadow: 0 8px 25px rgba(88, 166, 24, 0.1);
}

.sb-wiki-card h3 {
    font-size: 1.6rem;
    color: var(--sb-gold);
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    font-family: 'Cinzel', serif;
}

.sb-wiki-card h4 {
    font-size: 1.2rem;
    color: var(--sb-hytale-green-end);
    margin: 1.5rem 0 1rem 0;
    font-family: 'Cinzel', serif;
}

.sb-wiki-card p {
    line-height: 1.8;
    color: var(--sb-text-main);
    margin-bottom: 1rem;
}

.sb-wiki-card ul,
.sb-wiki-card ol {
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.sb-wiki-card ul {
    list-style: none;
}

.sb-wiki-card ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--sb-text-main);
}

.sb-wiki-card ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--sb-gold);
    font-weight: bold;
}

.sb-wiki-card ol {
    list-style: decimal;
    color: var(--sb-text-main);
}

.sb-wiki-card ol li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

/* --- CODE BLOCKS --- */
.sb-wiki-code-block {
    background: rgba(9, 18, 29, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-left: 4px solid var(--sb-hytale-green-start);
    border-radius: 6px;
    padding: 1.2rem 1.5rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.sb-wiki-code-block code {
    color: var(--sb-hytale-green-end);
    font-size: 0.95rem;
    font-weight: 600;
}

code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--sb-hytale-green-end);
    font-size: 0.9em;
}

/* --- ALERTES --- */
.sb-wiki-alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.sb-wiki-alert p {
    margin: 0;
    line-height: 1.6;
}

.sb-wiki-alert ul {
    margin: 0.5rem 0 0 0;
    list-style: none;
}

.sb-wiki-alert-info {
    background: rgba(0, 191, 255, 0.1);
    border-left-color: var(--sb-accent-blue);
}

.sb-wiki-alert-warning {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: var(--sb-gold);
}

.sb-wiki-alert-danger {
    background: rgba(255, 68, 68, 0.1);
    border-left-color: #FF4444;
}

/* --- NOTES --- */
.sb-wiki-note {
    font-style: italic;
    color: var(--sb-text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .sb-wiki-wrapper {
        flex-direction: column;
        margin-top: 70px;
    }

    .sb-wiki-sidebar {
        width: 100%;
        position: static;
        left: auto;
        height: auto;
        border-right: none;
        border-bottom: 2px solid rgba(255, 215, 0, 0.2);
        padding: 1.5rem 0;
    }
    .sb-wiki-content {
        padding: 2rem 1.5rem;
    }
    .sb-wiki-sidebar-header {
        padding: 0 1rem 1rem 1rem;
    }

    .sb-wiki-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
        gap: 0.8rem;
        -webkit-overflow-scrolling: touch;
    }

    .sb-wiki-nav-link {
        white-space: nowrap;
        min-width: fit-content;
        padding: 0.8rem 1.2rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .sb-wiki-nav-link:hover {
        padding-left: 1.2rem;
        border-left: none;
        border-bottom-color: var(--sb-gold);
    }

    .sb-wiki-nav-link.active {
        border-left: none;
        border-bottom-color: var(--sb-gold);
    }

    .sb-wiki-content {
        padding: 2rem 1.5rem;
    }

    .sb-wiki-hero {
        margin-bottom: 2.5rem;
    }

    .sb-wiki-title {
        font-size: 2rem;
    }

    .sb-wiki-subtitle {
        font-size: 1rem;
    }

    .sb-wiki-section-header h2 {
        font-size: 1.6rem;
    }

    .sb-wiki-card {
        padding: 1.5rem;
    }

    .sb-wiki-card h3 {
        font-size: 1.3rem;
    }

    .sb-wiki-card h4 {
        font-size: 1.1rem;
    }

    .sb-wiki-code-block {
        padding: 1rem;
        font-size: 0.85rem;
        overflow-x: auto;
    }
}

/* Scroll smooth pour les ancres */
html {
    scroll-behavior: smooth;
}

/* Scrollbar personnalisée pour la sidebar */
.sb-wiki-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sb-wiki-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sb-wiki-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.sb-wiki-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* ========================================
   NOUVEAU : RPG STATS & LEVELING
   ======================================== */

.sb-rpg-stat-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    
    /* MODIFICATION : GRID LAYOUT */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Crée des colonnes auto-adaptables */
    gap: 1rem;
}

.sb-rpg-stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
    
    /* Pour que les boites aient toutes la même hauteur */
    display: flex;
    flex-direction: column; 
    justify-content: flex-start;
}

.sb-rpg-stat-item:hover {
    transform: translateY(-3px); /* Effet de levitation léger */
    background: rgba(255, 255, 255, 0.08);
}

.sb-rpg-stat-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.sb-text-muted {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
}

/* --- COULEURS DES SKILLS --- */

/* Vitalité (Rouge) */
.sb-stat-vit { border-color: #ff4444; }
.sb-stat-vit .sb-rpg-stat-title { color: #ff4444; }

/* Endurance / Energie (Jaune/Orange) */
.sb-stat-sta { border-color: #ffbb00; }
.sb-stat-sta .sb-rpg-stat-title { color: #ffbb00; }

/* Défense / Bouclier (Bleu Acier) */
.sb-stat-def { border-color: #70a1ff; }
.sb-stat-def .sb-rpg-stat-title { color: #70a1ff; }

/* Dégâts (Rouge sombre) */
.sb-stat-dmg { border-color: #ff6b81; }
.sb-stat-dmg .sb-rpg-stat-title { color: #ff6b81; }

/* Mana (Violet) */
.sb-stat-man { border-color: #a55eea; }
.sb-stat-man .sb-rpg-stat-title { color: #a55eea; }

/* Réserves (Gris Tactique) */
.sb-stat-res { border-color: #a4b0be; }
.sb-stat-res .sb-rpg-stat-title { color: #a4b0be; }

/* Oxygène (Cyan) */
.sb-stat-oxy { border-color: #00d2d3; }
.sb-stat-oxy .sb-rpg-stat-title { color: #00d2d3; }

/* Minage & Bois (Vert/Brun Nature) */
.sb-stat-gat { border-color: #2ed573; }
.sb-stat-gat .sb-rpg-stat-title { color: #2ed573; }

/* Couleurs spécifiques par stat */
/* Force (Rouge) */
.sb-stat-str { border-color: #ff4444; }
.sb-stat-str .sb-rpg-stat-title { color: #ff4444; }

/* Dextérité (Vert) */
.sb-stat-dex { border-color: #00ff88; }
.sb-stat-dex .sb-rpg-stat-title { color: #00ff88; }

/* Intelligence (Bleu) */
.sb-stat-int { border-color: #00bfff; }
.sb-stat-int .sb-rpg-stat-title { color: #00bfff; }

/* Constitution (Jaune/Or) */
.sb-stat-con { border-color: #ffbb00; }
.sb-stat-con .sb-rpg-stat-title { color: #ffbb00; }