html {
    /* Évite la barre de défilement verticale ajoutée par Bulma */
    overflow-y: auto;
}

.char-name.title {
    margin-bottom: 0px;
}

/* ----- Sylvania Custom Styling ----- */
body {
    /* Gradient fallback : visible instantanément pendant le chargement de l'image */
    background-color: #0a1729;
    background-image:
        linear-gradient(135deg, rgba(10, 23, 41, 0.92) 0%, rgba(15, 30, 55, 0.85) 100%),
        url("/armory/img/armory_bg.webp");
    /* Couche supérieure : WebP en priorité, PNG en fallback navigateur ancien */
    background-image:
        linear-gradient(135deg, rgba(10, 23, 41, 0.92) 0%, rgba(15, 30, 55, 0.85) 100%),
        image-set(
            url("/armory/img/armory_bg.webp") type("image/webp") 1x,
            url("/armory/img/armory_bg.png")  type("image/png")  1x
        );
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    color: #f0f0f0;
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.section {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin: 40px auto;
    max-width: 1300px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem !important;
}

.title, .label, .table {
    color: #fff !important;
}

.table {
    background-color: transparent !important;
    color: #ddd !important;
}

.table thead th {
    color: #4a9eff !important;
    border-bottom: 2px solid #4a9eff !important;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.table td, .table th {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ----- Nav ----- */
.nav-container {
    padding: 20px 40px 0 40px;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.button.is-home {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.button.is-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    filter: brightness(1.2);
}


/* ----- DataTables + barre de recherche ----- */
.dataTables_wrapper .dataTables_filter {
    float: right;
    margin-bottom: 1.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(74, 158, 255, 0.3) !important;
    border-radius: 20px !important;
    color: #fff !important;
    padding: 8px 20px !important;
    outline: none !important;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
    min-width: 250px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.4), inset 0 2px 5px rgba(0,0,0,0.2) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.dataTables_wrapper .dataTables_length select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 5px !important;
    color: #fff !important;
    padding: 5px !important;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_info {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.9rem;
    padding-top: 1.5rem !important;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 1.5rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 5px !important;
    margin: 0 3px;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #4a9eff !important;
    color: white !important;
    border-color: #4a9eff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #4a9eff !important;
    color: white !important;
    border-color: #4a9eff !important;
    font-weight: bold;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----- Résultats : noms de personnages ----- */
#results a {
    color: #4a9eff;
    font-weight: 600;
    transition: color 0.2s ease;
}

#results a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Icônes ronds & ombrés dans les résultats */
#results img {
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ----- Sélecteur de royaume ----- */
#select-realm-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}
.realm-label {
    color: #aaa;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#select-realm {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(74, 158, 255, 0.3) !important;
    color: #fff !important;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
#select-realm:hover { border-color: #4a9eff !important; }

/* ----- Responsive ≤ 768 px (mobile / tablette portrait) ----- */
@media (max-width: 768px) {
    body {
        background-attachment: scroll; /* meilleure perf scroll sur mobile */
    }
    .section {
        margin: 16px 8px;
        padding: 1.2rem !important;
        border-radius: 10px;
    }
    .nav-container {
        padding: 12px 12px 0 12px;
    }
    .button.is-home {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    .dataTables_wrapper .dataTables_filter {
        float: none;
        margin-top: 0.5rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        min-width: 100%;
        box-sizing: border-box;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info {
        font-size: 0.8rem;
    }
    /* Titre énorme illisible sur petit écran */
    h1.title.is-size-2,
    h1.title[style*="3.5rem"] {
        font-size: 2rem !important;
    }
}

/* ----- Page d'erreur (404/500 retournés par le backend) ----- */
.section .columns.is-vcentered .title.is-size-2 {
    color: #ff6b6b !important;
}
.section .columns.is-vcentered .button.is-info {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}
