/* === STYLES GÉNÉRAUX === */
.wiki-niveau-wrapper {
    min-height: 100vh;
    padding-top: 60px;
    font-family: 'Courier New', monospace;
}

.niveau-overlay {
    background-color: rgba(0, 0, 0, 0.85);
    padding: 40px 20px;
}

/* === LAYOUT DESKTOP AMÉLIORÉ === */
.niveau-layout-desktop {
    max-width: 1400px;
    margin: 0 auto;
    gap: 30px;
    align-items: flex-start;
}

.niveau-sidebar {
    width: 320px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 10;
}

.niveau-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #ffc107; /* Couleur par défaut pour currentColor */
}

.niveau-header-card {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid currentColor;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.niveau-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, currentColor, transparent);
    opacity: 0.1;
    z-index: -1;
}

.niveau-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: currentColor;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.niveau-status-indicator {
    width: 60px;
    height: 4px;
    background: currentColor;
    margin: 0 auto;
    border-radius: 2px;
    animation: pulse 2s infinite;
}

.niveau-nav-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid currentColor;
    border-radius: 8px;
    padding: 20px;
}

.niveau-nav-card h4 {
    color: currentColor;
    font-size: 1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.niveau-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.niveau-nav-links li {
    margin-bottom: 8px;
}

.niveau-nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
}

.niveau-nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: currentColor;
    transform: translateX(5px);
}

.niveau-nav-links a.active {
    background: rgba(255, 255, 255, 0.15);
    color: currentColor;
    font-weight: bold;
    transform: translateX(5px);
    border-left: 3px solid currentColor;
    padding-left: 9px;
}

.niveau-nav-links a.active:hover {
    background: rgba(255, 255, 255, 0.2);
    color: currentColor;
}

.niveau-return-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid currentColor;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.btn-niveau-return {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    color: currentColor;
    border: 2px solid currentColor;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.btn-niveau-return:hover {
    background: currentColor;
    color: #000;
    transform: translateY(-2px);
}

.niveau-main-content {
    flex: 1;
    min-width: 0;
}

.niveau-content-wrapper {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid currentColor;
    border-radius: 12px;
    padding: 40px;
    position: relative;
}

.niveau-content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    pointer-events: none;
    border-radius: 12px;
}

/* === STYLES DE CONTENU AMÉLIORÉS === */
.niveau-content-wrapper .niveau-titre {
    font-size: 2.5rem;
    color: currentColor;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
}

.niveau-content-wrapper .niveau-titre::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
}

.niveau-content-wrapper .niveau-intro {
    background: rgba(0, 0, 0, 0.6);
    border-left: 4px solid currentColor;
    padding: 25px;
    margin: 30px 0;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.niveau-content-wrapper .niveau-intro::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 4rem;
    color: currentColor;
    opacity: 0.3;
    font-family: serif;
}

.niveau-content-wrapper .niveau-survie-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
    border: 2px solid currentColor;
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.niveau-content-wrapper .niveau-survie-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, currentColor, transparent);
    opacity: 0.05;
    z-index: -1;
}

.niveau-content-wrapper .section-titre {
    font-size: 1.8rem;
    color: currentColor;
    margin: 40px 0 20px 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid currentColor;
    padding-bottom: 10px;
}

.niveau-content-wrapper p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    text-align: justify;
}

.niveau-content-wrapper .niveau-image {
    margin: 40px 0;
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid currentColor;
    background: rgba(0, 0, 0, 0.5);
}

.niveau-content-wrapper .niveau-image img {
    max-width: 100%;
    display: block;
    border-radius: 10px;
}

.niveau-content-wrapper .niveau-image .caption {
    padding: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    background: rgba(0, 0, 0, 0.8);
}

/* === CONTAINER MOBILE (EXISTANT) === */
.niveau-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
}

.nav-user-link {
    color: #000;
    text-decoration: none;
    border-radius: 5px;
    height: 100%;
}

.nav-user-link:hover {
    text-decoration: underline;
    background-color: #000;
    color: #f5d73d;
}

.nav-avatar {
    border-radius: 50%;
    border: 1px solid #f5d73d;
    object-fit: cover;
    vertical-align: middle;
}

@media (max-width: 576px) {
    .nav-user-link span {
        display: none;
    }
}

/* === NIVEAU 0 === */
body.niveau-0 {
    background: url("/static/images/niveau_0_bg.jpg") no-repeat center center fixed;
    background-size: cover;
    background-color: #0f0f0f;
    color: #f5d73d;
}

body.niveau-0 nav.navbar {
    background-color: #dfd579 !important;
    border-bottom: 1px solid #f5d73d;
}

body.niveau-0 nav.navbar a {
    color: #000;
}

body.niveau-0 nav.navbar a:hover {
    color: #f5d73d;
}

.wiki-niveau-wrapper.niveau-0 {
    background: url("/static/images/niveau_0_bg.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #f5d73d;
}

.wiki-niveau-wrapper.niveau-0 .niveau-container {
    background-color: rgba(25, 25, 25, 0.92);
    border: 1px solid #f5d73d;
}

.wiki-niveau-wrapper.niveau-0 .niveau-titre,
.wiki-niveau-wrapper.niveau-0 .section-titre {
    color: #f5d73d;
}

.wiki-niveau-wrapper.niveau-0 .niveau-intro {
    background-color: #2c2c2c;
    border-left: 4px solid #f5d73d;
    padding: 12px;
    font-style: italic;
    margin-bottom: 20px;
    color: white;
}

.wiki-niveau-wrapper.niveau-0 .niveau-survie-box {
    background-color: #1a1a1a;
    border: 1px solid #f5d73d;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    color: white;
}

.wiki-niveau-wrapper.niveau-0 .niveau-survie-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #f5d73d;
}

.wiki-niveau-wrapper.niveau-0 .niveau-survie-box .niveau-classe {
    font-weight: bold;
    color: #fff;
}

.wiki-niveau-wrapper.niveau-0 .niveau-survie-box ul {
    list-style-type: square;
    margin-left: 20px;
}

.wiki-niveau-wrapper.niveau-0 .niveau-image img {
    max-width: 100%;
    border: 1px solid #f5d73d;
    border-radius: 4px;
}

.wiki-niveau-wrapper.niveau-0 .niveau-image .caption {
    font-size: 13px;
    color: #ccc;
    margin-top: 6px;
}

/* === NIVEAU 1 === */
body.niveau-1 {
    background: url("/static/images/bg_niv2.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #cceeff;
}

body.niveau-1 nav.navbar {
    background-color: #003344 !important;
    border-bottom: 1px solid #99ccff;
}

body.niveau-1 nav.navbar a {
    color: #cceeff;
}

body.niveau-1 nav.navbar a:hover {
    color: #99ccff;
}

.wiki-niveau-wrapper.niveau-1 {
    background: url("/static/images/niveau_1_parking.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #cceeff;
}

.wiki-niveau-wrapper.niveau-1 .niveau-container {
    background-color: rgba(20, 20, 20, 0.95);
    border: 1px solid #99ccff;
}

.wiki-niveau-wrapper.niveau-1 .niveau-titre,
.wiki-niveau-wrapper.niveau-1 .section-titre {
    color: #99ccff;
}

.wiki-niveau-wrapper.niveau-1 .niveau-intro {
    background-color: #1e1e1e;
    border-left: 4px solid #99ccff;
    padding: 12px;
    font-style: italic;
    margin-bottom: 20px;
    color: white;
}

.wiki-niveau-wrapper.niveau-1 .niveau-survie-box {
    background-color: #121212;
    border: 1px solid #99ccff;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    color: white;
}

.wiki-niveau-wrapper.niveau-1 .niveau-survie-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #99ccff;
}

.wiki-niveau-wrapper.niveau-1 .niveau-survie-box .niveau-classe {
    font-weight: bold;
    color: #fff;
}

.wiki-niveau-wrapper.niveau-1 .niveau-survie-box ul {
    list-style-type: square;
    margin-left: 20px;
}

.wiki-niveau-wrapper.niveau-1 .niveau-image img {
    max-width: 100%;
    border: 1px solid #99ccff;
    border-radius: 4px;
}

.wiki-niveau-wrapper.niveau-1 .niveau-image .caption {
    font-size: 13px;
    color: #e0e0e0;
    margin-top: 6px;
}

/* === NIVEAU 2 === */
body.niveau-2 {
    background: url("/static/images/bg_niveau_2.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #ffccaa; /* Teinte légèrement chaude pour contraster avec l'environnement sombre */
}

body.niveau-2 nav.navbar {
    background-color: #331a00 !important; /* Brun foncé industriel */
    border-bottom: 1px solid #ff9966;
}

body.niveau-2 nav.navbar a {
    color: #ffccaa;
}

body.niveau-2 nav.navbar a:hover {
    color: #ff9966;
}

.wiki-niveau-wrapper.niveau-2 {
    background-size: cover;
    color: #ffccaa;
}

.wiki-niveau-wrapper.niveau-2 .niveau-container {
    background-color: rgba(15, 8, 0, 0.90); /* Brun presque noir avec transparence */
    border: 1px solid #ff9966;
}

.wiki-niveau-wrapper.niveau-2 .niveau-titre,
.wiki-niveau-wrapper.niveau-2 .section-titre {
    color: #ff9966;
}

.wiki-niveau-wrapper.niveau-2 .niveau-intro {
    background-color: #1a0d00;
    border-left: 4px solid #ff9966;
    padding: 12px;
    font-style: italic;
    margin-bottom: 20px;
    color: white;
}

.wiki-niveau-wrapper.niveau-2 .niveau-survie-box {
    background-color: #140a00;
    border: 1px solid #ff9966;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    color: white;
}

.wiki-niveau-wrapper.niveau-2 .niveau-survie-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #ff9966;
}

.wiki-niveau-wrapper.niveau-2 .niveau-survie-box .niveau-classe {
    font-weight: bold;
    color: #fff;
}

.wiki-niveau-wrapper.niveau-2 .niveau-survie-box ul {
    list-style-type: square;
    margin-left: 20px;
}

.wiki-niveau-wrapper.niveau-2 .niveau-image img {
    max-width: 100%;
    border: 1px solid #ff9966;
    border-radius: 4px;
}

.wiki-niveau-wrapper.niveau-2 .niveau-image .caption {
    font-size: 13px;
    color: #e0e0e0;
    margin-top: 6px;
}

.niveau-entites {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.entite {
    text-align: center;
    width: 120px; /* largeur fixe du bloc */
}

.entite-img {
    width: 100%; /* l'image remplit le bloc */
    height: 120px; /* hauteur fixe */
    object-fit: cover; /* coupe et ajuste l'image proprement */
    border: 1px solid #ff9966; /* ou la couleur que tu souhaites */
    border-radius: 4px;
}

.caption {
    font-size: 12px;
    color: #ddd;
    margin-top: 4px;
}

/* =================== NIVEAU 3 =========================*/

/* === NIVEAU 3 === */
body.niveau-3 {
    background: url("/static/images/bg_niv_3.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #ffccaa; /* teinte légèrement chaude sur fond sombre */
}

body.niveau-3 nav.navbar {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #ff6633;
}

body.niveau-3 nav.navbar a {
    color: #ffccaa;
}

body.niveau-3 nav.navbar a:hover {
    color: #ff6633;
}

.wiki-niveau-wrapper.niveau-3 {
    background-size: cover;
    color: #ffccaa;
}

.wiki-niveau-wrapper.niveau-3 .niveau-container {
    background-color: rgba(10, 10, 10, 0.9);
    border: 1px solid #ff6633;
}

.wiki-niveau-wrapper.niveau-3 .niveau-titre,
.wiki-niveau-wrapper.niveau-3 .section-titre {
    color: #ff6633;
}

.wiki-niveau-wrapper.niveau-3 .niveau-intro {
    background-color: #111;
    border-left: 4px solid #ff6633;
    padding: 12px;
    font-style: italic;
    margin-bottom: 20px;
    color: white;
}

.wiki-niveau-wrapper.niveau-3 .niveau-survie-box {
    background-color: #141414;
    border: 1px solid #ff6633;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    color: white;
}

.wiki-niveau-wrapper.niveau-3 .niveau-survie-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #ff6633;
}

.wiki-niveau-wrapper.niveau-3 .niveau-survie-box .niveau-classe {
    font-weight: bold;
    color: #fff;
}

.wiki-niveau-wrapper.niveau-3 .niveau-survie-box ul {
    list-style-type: square;
    margin-left: 20px;
}

.wiki-niveau-wrapper.niveau-3 .niveau-image img {
    max-width: 100%;
    border: 1px solid #ff6633;
    border-radius: 4px;
}

.wiki-niveau-wrapper.niveau-3 .niveau-image .caption {
    font-size: 13px;
    color: #ccc;
    margin-top: 6px;
}

.niveau-entites {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.entite {
    text-align: center;
    width: 120px;
}

.entite-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border: 1px solid #ff6633;
    border-radius: 4px;
}

.caption {
    font-size: 12px;
    color: #ddd;
    margin-top: 4px;
}

/* === GALERIES D'IMAGES === */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
    margin: 20px 0;
}

.image-gallery.gallery-2 .gallery-item {
    flex: 0 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
}

.image-gallery.gallery-3 .gallery-item {
    flex: 0 1 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
}

.image-gallery.gallery-4 .gallery-item {
    flex: 0 1 calc(25% - 12px);
    max-width: calc(25% - 12px);
}

.gallery-item {
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border: 2px solid currentColor;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.gallery-item .caption {
    margin-top: 8px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

.gallery-caption {
    text-align: center;
    margin-top: 15px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

/* Responsive galeries */
@media (max-width: 768px) {
    .image-gallery.gallery-3 .gallery-item,
    .image-gallery.gallery-4 .gallery-item {
        flex: 0 1 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .image-gallery .gallery-item {
        flex: 0 1 100%;
        max-width: 100%;
    }
}

/* === STYLES RESPONSIVE === */

/* Tablet et petits écrans */
@media (max-width: 1199px) {
    .niveau-layout-desktop {
        max-width: 1200px;
        gap: 20px;
    }
    
    .niveau-sidebar {
        width: 280px;
    }
    
    .niveau-content-wrapper {
        padding: 30px;
    }
}

/* Mobile et tablet portrait */
@media (max-width: 991px) {
    .wiki-niveau-wrapper {
        padding-top: 20px;
    }
    
    .niveau-overlay {
        padding: 20px 15px;
    }
    
    .niveau-layout-desktop {
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
    }
    
    .niveau-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        order: -1;
    }
    
    .niveau-sidebar-content {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        gap: 15px;
        align-items: start;
    }
    
    .niveau-header-card {
        padding: 15px;
    }
    
    .niveau-number {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .niveau-nav-card {
        padding: 15px;
    }
    
    .niveau-nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .niveau-nav-links li {
        margin-bottom: 0;
    }
    
    .niveau-nav-links a {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
        border-radius: 20px;
        border: 1px solid currentColor;
        background: rgba(0, 0, 0, 0.3);
    }
    
    .niveau-nav-links a:hover,
    .niveau-nav-links a.active {
        transform: none;
        border-left: none;
        padding-left: 12px;
        background: currentColor;
        color: #000;
    }
    
    .niveau-return-card {
        padding: 10px;
    }
    
    .btn-niveau-return {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .niveau-main-content {
        order: 2;
    }
    
    .niveau-content-wrapper {
        padding: 25px 20px;
    }
    
    .niveau-content-wrapper .niveau-titre {
        font-size: 1.8rem;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }
    
    .niveau-content-wrapper .niveau-intro {
        padding: 20px;
        font-size: 1rem;
        margin: 20px 0;
    }
    
    .niveau-content-wrapper .niveau-survie-box {
        padding: 20px;
        margin: 20px 0;
    }
    
    .niveau-content-wrapper .section-titre {
        font-size: 1.4rem;
        margin: 30px 0 15px 0;
        letter-spacing: 1px;
    }
    
    .niveau-content-wrapper p {
        font-size: 0.95rem;
        line-height: 1.6;
        text-align: left;
        margin-bottom: 15px;
    }
}

/* Mobile seulement */
@media (max-width: 767px) {
    .wiki-niveau-wrapper {
        padding-top: 10px;
    }
    
    .niveau-overlay {
        padding: 15px 10px;
    }
    
    .niveau-sidebar-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .niveau-header-card {
        padding: 12px;
    }
    
    .niveau-number {
        font-size: 1.1rem;
        margin-bottom: 6px;
        letter-spacing: 1px;
    }
    
    .niveau-nav-card h4 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .niveau-nav-links a {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .btn-niveau-return {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .niveau-content-wrapper {
        padding: 20px 15px;
        border-radius: 8px;
    }
    
    .niveau-content-wrapper .niveau-titre {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
        line-height: 1.2;
    }
    
    .niveau-content-wrapper .niveau-intro {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .niveau-content-wrapper .niveau-intro::before {
        font-size: 3rem;
        top: -5px;
        left: 10px;
    }
    
    .niveau-content-wrapper .niveau-survie-box {
        padding: 15px;
    }
    
    .niveau-content-wrapper .niveau-survie-box h3 {
        font-size: 1.1rem;
    }
    
    .niveau-content-wrapper .section-titre {
        font-size: 1.2rem;
        margin: 25px 0 12px 0;
        letter-spacing: 0.5px;
    }
    
    .niveau-content-wrapper p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    /* Responsive pour les entités */
    .niveau-entites {
        gap: 15px;
        justify-content: center;
    }
    
    .entite {
        width: 100px;
    }
    
    .entite-img {
        height: 100px;
    }
    
    .caption {
        font-size: 11px;
    }
    
    /* Images responsive */
    .niveau-content-wrapper .niveau-image {
        margin: 25px 0;
        border-radius: 8px;
    }
    
    .niveau-content-wrapper .niveau-image img {
        border-radius: 6px;
    }
    
    .niveau-content-wrapper .niveau-image .caption {
        padding: 12px;
        font-size: 12px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .niveau-overlay {
        padding: 10px 5px;
    }
    
    .niveau-sidebar-content {
        gap: 12px;
    }
    
    .niveau-nav-links {
        justify-content: center;
        gap: 6px;
    }
    
    .niveau-nav-links a {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .niveau-content-wrapper {
        padding: 15px 10px;
    }
    
    .niveau-content-wrapper .niveau-titre {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .niveau-content-wrapper .niveau-intro {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .niveau-content-wrapper .section-titre {
        font-size: 1.1rem;
        margin: 20px 0 10px 0;
    }
    
    .niveau-content-wrapper p {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .entite {
        width: 80px;
    }
    
    .entite-img {
        height: 80px;
    }
}

/* Fix pour les anciens niveaux qui utilisent le container mobile */
@media (max-width: 991px) {
    .wiki-niveau-wrapper .niveau-container {
        padding: 20px;
        margin: 0;
    }
}

@media (max-width: 767px) {
    .wiki-niveau-wrapper .niveau-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .wiki-niveau-wrapper .niveau-container {
        padding: 12px;
    }
}

/* === ENCADRÉ DE DIFFICULTÉ (pages rédigées avec difficulty-box) === */
.niveau-content-wrapper .difficulty-box,
.niveau-container .difficulty-box {
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid currentColor;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.03);
}
.difficulty-box .difficulty-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.difficulty-box .difficulty-text h2 {
    font-size: 1.25rem;
    margin: 0 0 4px;
}
.difficulty-box .difficulty-text p { margin: 0; opacity: 0.85; }
.niveau-content-wrapper .footer-note,
.niveau-container .footer-note {
    margin-top: 30px;
    padding-top: 12px;
    border-top: 1px dashed currentColor;
    font-size: 0.85rem;
    opacity: 0.75;
    font-style: italic;
}
.gallery-caption { font-size: 0.8rem; margin-top: 6px; opacity: 0.85; }

/* === IMAGES : jamais plus larges que leur colonne === */
.niveau-content-wrapper img,
.niveau-container img { max-width: 100%; height: auto; }
.niveau-content-wrapper .entite-img,
.niveau-container .entite-img { height: 120px; }
.niveau-image { text-align: center; }
.niveau-image img { display: block; margin: 0 auto; }

/* === MOBILE : pas de débordement horizontal === */
@media (max-width: 991.98px) {
    .wiki-niveau-wrapper { padding-top: 20px; overflow-x: hidden; }
    .niveau-overlay { padding: 20px 0; }
    .niveau-container { padding: 16px; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
    .niveau-container .niveau-titre { font-size: 1.6rem; letter-spacing: 1px; }
    .niveau-container .container { padding-left: 0; padding-right: 0; }
    .image-gallery .gallery-item { flex: 1 1 100% !important; max-width: 100% !important; }
    .difficulty-box { flex-direction: column; text-align: center; }
}

/* Le guillemet décoratif de la citation va dans le coin droit : à gauche il chevauchait le texte */
.niveau-content-wrapper .niveau-intro::before,
.niveau-container .niveau-intro::before {
    left: auto;
    right: 15px;
    top: -12px;
}
.niveau-content-wrapper .niveau-intro,
.niveau-container .niveau-intro { padding-right: 50px; }

/* === MENU DE GAUCHE : couleur du niveau (au lieu du jaune pour tous) === */
.wiki-niveau-wrapper.niveau-0 .niveau-sidebar-content { color: #f5d73d; }
.wiki-niveau-wrapper.niveau-1 .niveau-sidebar-content { color: #99ccff; }
.wiki-niveau-wrapper.niveau-2 .niveau-sidebar-content { color: #ff9966; }
.wiki-niveau-wrapper.niveau-3 .niveau-sidebar-content { color: #ff6633; }

/* === PHOTOS À VENIR : cadre réservé tant que l'image n'est pas fournie === */
.photo-a-venir {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px dashed currentColor;
    border-radius: 10px;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 12px, rgba(255,255,255,0.06) 12px 24px);
    text-align: center;
    padding: 10px;
    opacity: 0.85;
}
.photo-a-venir span { font-style: italic; }
.photo-a-venir .photo-fichier { font-size: 0.75em; opacity: 0.7; font-style: normal; word-break: break-all; }
.photo-a-venir.photo-salle { width: 100%; aspect-ratio: 16 / 9; font-size: 1rem; }
.photo-a-venir.photo-entite { width: 120px; height: 120px; font-size: 0.68rem; line-height: 1.25; padding: 6px; }
.photo-a-venir.photo-entite .photo-fichier { display: none; }
.niveau-entites { display: flex; flex-wrap: wrap; gap: 16px; }
.niveau-entites .entite .caption { text-align: center !important; font-size: 0.85rem; line-height: 1.3; margin-top: 6px; word-spacing: normal; }

/* === FICHES D'ENTITÉS === */
.portrait-entite { max-width: 420px; margin: 0 auto 25px; }
.portrait-entite img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.photo-a-venir.photo-portrait { width: 100%; aspect-ratio: 1 / 1; font-size: 0.95rem; }
.niveau-entites a.lien-entite { text-decoration: none !important; display: block; transition: transform 0.2s; }
.niveau-entites a.lien-entite:hover { transform: translateY(-3px); }
