/* =============================================
   MODERN DARK THEME - TrackyServer
   Ce fichier surcharge tracky.css
   ============================================= */

/* --- Variables de couleurs ---
   On définit les couleurs ici une seule fois.
   Si tu veux changer une couleur, tu la changes
   juste ici et ça s'applique partout.
*/
:root {
    --bg-primary:    #16181C;
    --bg-secondary:  #27292E;
    --bg-nav:        #27292E;
    --text-primary:  #ffffff;
    --text-muted:    #9090b0;
    --accent:        #e8861a;
    --border:        #2a2a42;
    --card-hover:    #22223a;
    /* Écrase la variable de police Bootstrap 5 */
    --bs-font-sans-serif:   'Poppins', sans-serif;
    --bs-body-font-family:  'Poppins', sans-serif;
}

/* Retire le cadre de focus par défaut du navigateur au clic (souris),
   tout en le gardant pour la navigation clavier (accessibilité) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Force Poppins partout — écrase Bootstrap 3 & 5 sur les éléments de formulaire
   et les composants qui redéfinissent leur propre police */
input, button, select, textarea, optgroup,
.form-control, .btn,
.input-group-addon, .input-group-text,
.nav-link, .dropdown-item, .dropdown-menu,
.panel, .panel-body, .panel-heading,
.alert, .badge, .label, .modal-content,
.pagination > li > a, .pagination > li > span,
.list-group-item, .breadcrumb,
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif !important;
}

/* --- Boutons submit formulaires --- */
.btn-primary.col-lg-4 {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.btn-primary.col-lg-4:hover,
.btn-primary.col-lg-4:focus {
    background-color: color-mix(in srgb, var(--accent) 85%, #000) !important;
    border-color: color-mix(in srgb, var(--accent) 85%, #000) !important;
}

/* --- Fond général de la page --- */
html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary) !important;
}
body {
    margin: 0;
    padding: 0;
    padding-top: 70px; /* compense la navbar fixed */
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}

.publift_ads.server_header {
    margin: 0;
}

.publift_ads.server_header:has(.fuse-slot iframe) {
    margin: 16px 0 24px;
}

/* --- Navbar (fixed — immunisée contre tout padding/margin externe) --- */
#main-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background-color: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    border-top: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 10px 0;
    z-index: 1030;
}

.ts-brand-link {
    text-decoration: none;
    margin-right: 1rem;
}

.ts-brand-link:hover {
    text-decoration: none;
}

.ts-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.ts-brand img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.ts-brand span {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 24px;
}

/* #main-navbar .navbar-brand:hover {
    color: var(--accent);
} */

#main-navbar .nav-link {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    padding-left: 14px !important;
    padding-right: 14px !important;
    white-space: nowrap;
}

#main-navbar .nav-link:hover {
    color: var(--text-primary);
}

.ts-tabs-scroll-wrap {
    position: relative;
}

/* Scroll horizontal des onglets + fondu au bout, mobile/tablette/desktop
   intermédiaire (jusqu'à 1199px, sinon le bouton Connect to est inaccessible
   entre 992 et 1199px faute de place). */
@media (max-width: 1199px) {
    #details_tab {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #details_tab::-webkit-scrollbar { display: none; }
    #details_tab .nav-link { white-space: nowrap; }
    .ts-tabs-scroll-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, rgba(39, 41, 46, 1));
        pointer-events: none;
    }
    /* Plus rien à scroller à droite : le fondu n'a plus lieu d'être */
    .ts-tabs-scroll-wrap--at-end::after {
        display: none;
    }
}

#details_tab {
    --bs-nav-tabs-link-active-bg: transparent;
    --bs-nav-tabs-link-active-color: var(--accent);
    --bs-nav-tabs-link-active-border-color: transparent transparent var(--accent);
    --bs-nav-tabs-border-color: rgba(255, 255, 255, 0.12);
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
    padding-bottom: 14px;
    margin-bottom: 16px;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 6px;
    width: 100%;
}

#details_tab .nav-link {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--text-muted);
    padding: 8px 10px !important;
    font-size: 16px;
    white-space: nowrap;
}

#details_tab .nav-link.active {
    background-color: rgba(0, 0, 0, 0.25) !important;
    border-color: transparent !important;
    border-bottom-color: transparent !important;
    border-radius: 8px !important;
    color: var(--accent) !important;
}

#details_tab .nav-link:hover {
    color: var(--text-primary);
}

#details_tab .nav-link:focus,
#details_tab .nav-link:focus-visible,
#details_tab .nav-link.active:focus {
    outline: none !important;
    box-shadow: none !important;
}

#details_tab .nav-link--connect {
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    border-radius: 8px !important;
    color: #fff !important;
    padding: 6px 14px !important;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

#details_tab .nav-link--connect:hover {
    background: #c96e0e !important;
    border-color: #c96e0e !important;
    color: #fff !important;
}

#details_tab .nav-link--connect-discord {
    background: #5865F2 !important;
    border-color: #5865F2 !important;
    padding: 6px 12px !important;
}

#details_tab .nav-link--connect-discord:hover {
    background: #4752c4 !important;
    border-color: #4752c4 !important;
    color: #fff !important;
}

/* =============================================
   SERVER DETAIL — tab #general : info panel
   ============================================= */

.server-info-panel {
    padding: 4px 0 0;
}

/* Barre de stats (status, joueurs, votes, favoris) */
.server-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    width: 100%;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    flex: 1;
    gap: 4px;
    white-space: nowrap;
}

.stat-chip-top {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-chip-top i {
    font-size: 16px;
    color: var(--accent);
}

.stat-chip .connected_player,
.stat-chip .u_votes,
.stat-chip .u_favorites {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-chip-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.stat-chip--online .stat-chip-top,
.stat-chip--online .stat-chip-top i,
.stat-chip--online .stat-chip-label {
    color: #22c55e !important;
}

.stat-chip--offline .stat-chip-top,
.stat-chip--offline .stat-chip-top i,
.stat-chip--offline .stat-chip-label {
    color: #ef4444 !important;
}

.stat-chip--players i { color: var(--accent); }

.stat-chip--favs i { color: #f59e0b; }

/* Lignes d'information */
.server-info-rows {
    display: flex;
    flex-direction: column;
}

.server-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.info-label {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    min-width: 130px;
    flex-shrink: 0;
}

.info-value {
    color: var(--text-primary);
    font-size: 15px;
    margin-left: auto;
    text-align: right;
}

.info-value a {
    color: var(--text-primary) !important;
    text-decoration: none;
}

.info-value a:hover {
    color: var(--accent) !important;
}

/* Badge/tag moderne (remplace .label Bootstrap 3) */
.server-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(232, 134, 26, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(232, 134, 26, 0.25);
    transition: background 0.15s;
}

.server-tag:hover {
    background: rgba(232, 134, 26, 0.22);
}

#main-navbar .dropdown-menu {
    background-color: var(--bg-secondary);
    border: 1px solid rgba(144, 144, 176, 0.4);
}

#main-navbar .dropdown-item {
    color: var(--text-muted);
    font-size: 15px;
    padding: 10px 20px;
}

#main-navbar .dropdown-item:hover {
    background-color: var(--card-hover);
    color: var(--text-primary);
}

#main-navbar .dropdown-menu {
    min-width: 200px;
    padding: 8px 0;
}

#main-navbar .navbar-nav {
    gap: 6px;
}

/* --- Conteneur principal --- */
.container {
    background-color: transparent;
    padding-top: 15px;
}

#main-navbar .container,
.sticky-footer .container {
    padding-top: 0;
}

/* --- Panels (cartes serveurs actuelles) --- */
.panel,
.panel-default {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    border-radius: 10px !important;
    overflow: hidden;
}

.panel-body {
    color: var(--text-primary) !important;
    font-size: 16px;
}

.panel-heading {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

.panel-body label {
    font-size: 14px;
}

.panel-body .btn {
    font-size: 15px;
}

/* --- Éléments de contenu dark theme (listings, descriptions) --- */
pre, code {
    background-color: var(--bg-primary) !important;
    color: #e0e0f0 !important;
    border-color: var(--border) !important;
}
pre {
    padding: 14px 16px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    line-height: 1.6;
}
.well {
    background-color: var(--bg-primary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
}
blockquote {
    border-left-color: var(--accent) !important;
    color: var(--text-muted) !important;
    background-color: rgba(232, 134, 26, 0.06);
    border-radius: 0 6px 6px 0;
    padding: 10px 16px;
}
.label-default {
    background-color: var(--bg-primary) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border);
}
kbd {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

/* --- Textes dans les panels --- */
.panel a,
.panel h4,
.panel h3 {
    color: var(--text-primary) !important;
}

h3.ts-section-title {
    color: var(--accent) !important;
    margin-top: 18px !important;
    margin-bottom: 14px !important;
}
h3.ts-section-title + hr {
    margin-bottom: 20px;
}

/* --- Formulaires et inputs --- */
.form-control {
    background-color: transparent !important;
    border: 1px solid #444466 !important;
    color: var(--text-primary) !important;
    font-size: 15px !important;
}

select.form-control option {
    font-size: 15px;
    background-color: transparent;
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-control:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(232, 134, 26, 0.2) !important;
}

.panel-body .form-control,
.panel-body input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
.panel-body select,
.panel-body textarea {
    background-color: var(--bg-primary) !important;
    border: 1px solid #555570 !important;
    border-radius: 8px !important;
}

/* --- Input group (adresse IP des serveurs) --- */
.input-group-addon i {
    margin-right: 5px;
}

.input-group-addon {
    background-color: transparent !important;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
}

/* --- Alertes (compteur de résultats) --- */
.alert-info {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 0 14px 0 12px !important;
    margin-bottom: 16px !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-height: 48px;
}

.alert-info .fa-list-alt { display: none; }
.alert-info strong {
    color: var(--accent) !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    border-radius: 8px !important;
    color: #fca5a5 !important;
    padding: 14px 18px !important;
    margin-bottom: 16px !important;
    font-size: 15px !important;
    font-weight: 500;
}

.alert-error strong,
.alert-danger strong {
    color: #ef4444 !important;
    font-weight: 700;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(34, 197, 94, 0.5) !important;
    border-radius: 8px !important;
    color: #86efac !important;
    padding: 14px 18px !important;
    margin-bottom: 16px !important;
    font-size: 15px !important;
    font-weight: 500;
}

.alert-success strong {
    color: #22c55e !important;
    font-weight: 700;
}

.alert-warning {
    background: #ffffff !important;
    border: 1px solid rgba(232, 134, 26, 0.5) !important;
    border-radius: 8px !important;
    color: #3a3a3a !important;
    padding: 14px 18px !important;
    margin-bottom: 16px !important;
    font-size: 15px !important;
    font-weight: 500;
}

.alert-warning strong {
    color: var(--accent) !important;
    font-weight: 700;
}

.alert-warning code {
    background: rgba(0, 0, 0, 0.06);
    color: #3a3a3a;
}

/* Bloc "chemin de fichier" façon terminal, utilisé dans le guide Palworld */
.guide-filepath {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: Consolas, monospace;
    font-size: 0.85em;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 6px 0;
}
.guide-filepath .muted { opacity: 0.7; }

.guide-list {
    margin: 6px 0 4px 18px;
    padding: 0;
}

.guide-note {
    font-size: 0.9em;
}

/* Champ masqué visuellement sans être type="password" (évite le popup
   "enregistrer le mot de passe" du navigateur pour des identifiants qui ne
   sont pas des logins) */
.pw-masked {
    -webkit-text-security: disc;
}

/* Badge de réassurance sécurité (ex: mot de passe chiffré) */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.85em;
    font-weight: 700;
    margin: 6px 0 4px;
}

.alert .close { display: none !important; }

/* --- Dropdowns --- */
.dropdown-menu {
    background-color: var(--bg-secondary) !important;
    border-color: rgba(144, 144, 176, 0.4) !important;
    border-radius: 8px !important;
}

.dropdown-menu > li > a {
    color: var(--text-primary) !important;
    font-size: 15px;
    text-decoration: none !important;
}

.dropdown-menu > li > a:hover {
    background-color: var(--card-hover) !important;
    /* color: var(--accent) !important; */
}

/* --- Navigation pills (filtres) --- */
.nav-pills > li > a {
    color: var(--text-primary) !important;
    background-color: var(--bg-secondary) !important;
}

.nav-pills > li.active > a,
.nav-pills > li > a:hover {
    background-color: var(--card-hover) !important;
    color: var(--accent) !important;
}


/* --- Footer --- */
.sticky-footer {
    background-color: var(--bg-nav) !important;
    border-top: 1px solid var(--border);
    color: var(--text-primary) !important;
    padding: 40px 0 20px;
}

.opd_adsticky {
    background-color: var(--bg-nav) !important;
}

.sticky-footer a {
    color: var(--text-primary) !important;
    text-decoration: none;
}

.sticky-footer a:hover {
    color: var(--accent) !important;
}

.sticky-footer h4.title {
    color: var(--accent) !important;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.sticky-footer hr {
    border-color: var(--border) !important;
}

.ts-footer-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 32px;
    padding-bottom: 20px;
    margin: 0 !important;
}

.ts-footer-col {
    flex: 1 1 160px;
    min-width: 0;
}

.ts-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ts-footer-links li,
.ts-footer-links a {
    color: var(--text-primary) !important;
    font-size: 14px;
    text-decoration: none;
}

.ts-footer-icon {
    width: 16px;
    text-align: center;
    margin-right: 6px;
    color: var(--text-primary);
}

.ts-social-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 8px;
    filter: brightness(0) invert(1);
    vertical-align: middle;
}

.ts-footer-col p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
}

.ts-footer-copy {
    text-align: center;
    padding: 16px 0 4px;
    border-top: 1px solid #ffffff;
    margin-top: 8px;
}

.ts-footer-copy a {
    color: var(--text-primary) !important;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ts-footer-paypal {
    color: var(--text-primary) !important;
    display: inline-block;
    margin-top: 8px;
}

/* --- Labels (badges votes, map, etc.) --- */
.label-default {
    background-color: var(--border) !important;
    color: var(--text-primary) !important;
}

/* --- Barre résultats + pagination top --- */
.ts-list-header {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 8px;
    min-height: 46px;
    padding: 8px 0;
}
.ts-list-header .alert {
    margin-bottom: 0 !important;
    flex: 0 0 auto;
}
.ts-list-header .pagination {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}
/* Rendue en PHP à côté de la barre de filtres ; cachée par défaut (desktop),
   affichée uniquement mobile+tablette ci-dessous. */
.cat-mobile-tagcount-row { display: none; }
@media (max-width: 991px) {
    /* Compteur au-dessus de la pagination (copie desktop dans .ts-list-header cachée) ;
       !important nécessaire pour battre .alert-info { display: flex !important; } */
    .ts-list-header .alert { display: none !important; }
    .cat-mobile-tagcount-row {
        display: block;
        margin-bottom: 10px;
    }
    .ts-count-moved {
        width: 100%;
    }
    .ts-count-moved .alert {
        margin: 0;
        padding: 0 14px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 14px;
        border-radius: 10px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        line-height: 1;
    }
    .ts-count-moved .alert .close { display: none; }
}

/* --- Pagination --- */
.pagination {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 2px;
}
.pagination > li > a,
.pagination > li > span {
    background: none !important;
    border: none !important;
    outline: none !important;
    color: var(--text-muted) !important;
    width: 36px;
    height: 36px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > span {
    background-color: var(--accent) !important;
    border: none !important;
    color: #fff !important;
}
.pagination > li > a:hover {
    background-color: rgba(232, 134, 26, 0.15) !important;
    color: var(--accent) !important;
}
.pagination > .disabled > a,
.pagination > .disabled > span {
    background: none !important;
    border: none !important;
    color: var(--text-muted) !important;
    cursor: default;
    pointer-events: none;
    padding-bottom: 6px !important;
}
.pagination > .pg-arrow > a {
    font-size: 30px;
    font-weight: 300;
}
.pg-arrow-icon {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

/* --- Liens généraux --- */
a {
    color: var(--text-primary);
}

a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- Bootstrap modals — thème sombre --- */
.modal .modal-content {
    background-color: #27292E !important;
    color: #ffffff !important;
    border: 1px solid #2a2a42 !important;
}
.modal .modal-header {
    border-bottom: 1px solid #2a2a42 !important;
}
.modal .modal-footer {
    border-top: 1px solid #2a2a42 !important;
}
.modal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.7;
}
.modal .modal-title,
.modal .modal-body,
.modal .modal-body p,
.modal .modal-body label,
.modal .modal-body span {
    color: #ffffff !important;
}
.modal .modal-body .form-control {
    background-color: #16181C !important;
    color: #ffffff !important;
    border-color: #2a2a42 !important;
}

/* --- Modal vote custom --- */
#ts-vote-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    padding: 12px;
}
#ts-vote-overlay.open {
    display: grid;
    place-items: center;
}
#ts-vote-box {
    background: var(--bg-secondary);
    border: 1px solid #555570;
    border-radius: 8px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    z-index: 10000;
    color: var(--text-primary);
}
#ts-vote-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
#ts-vote-close:hover { color: var(--text-primary); }
#ts-vote-box h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 20px;
    padding-right: 30px;
}
#ts-vote-box p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 8px;
}
#ts-vote-box p a { color: var(--accent); }
#ts-vote-box label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
}
#ts-vote-box .form-control {
    background-color: var(--bg-primary) !important;
    border: 1px solid #555570 !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 10px 14px;
}
#ts-vote-box .btn {
    font-size: 15px;
    min-width: 80px;
    padding-left: 20px;
    padding-right: 20px;
}
.ts-vote-footer-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #555570;
    margin-top: 4px;
}
.ts-vote-copy-row {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #555570;
}
.ts-vote-copy-btn {
    background: var(--bg-primary);
    border: 1px solid #6b6b88;
    color: var(--text-primary);
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 8px;
    margin-top: 8px;
}
.ts-vote-copy-btn:hover { color: var(--text-muted); border-color: #555570; }

/* --- Modal custom (indépendant de Bootstrap) --- */
#ts-login-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    padding: 12px;
}

#ts-login-overlay.open {
    display: grid;
    place-items: center;
}

#ts-login-box {
    background: var(--bg-secondary);
    border: 1px solid #555570;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

#ts-login-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

#ts-login-close:hover { color: var(--text-primary); }

#ts-login-box h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 700;
}

/* Onglets login/register */
.ts-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid #555570; }
.ts-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    padding: 8px 16px;
    cursor: pointer;
    margin-bottom: -1px;
}
.ts-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.ts-tab-pane { display: none; }
.ts-tab-pane.active { display: block; }

/* Nav pills — accent orange */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--accent) !important;
    color: #fff !important;
}
.nav-pills .nav-link {
    color: var(--text-primary);
}

/* Champs dans la modal */
#ts-login-box label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
}
#ts-login-box .form-control {
    margin-bottom: 16px;
    background-color: var(--bg-primary) !important;
    border: 1px solid #555570 !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 10px 14px;
}
#ts-login-box .form-control:focus {
    border-color: var(--accent) !important;
    outline: none;
    box-shadow: none !important;
}

/* Bouton submit modal */
.ts-submit-btn {
    background-color: #FF8415;
    color: #ffffff;
    border: none;
    font-size: 14px;
    padding: 6px 20px;
    margin-right: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}
.ts-submit-btn:hover {
    background-color: #e8750f;
    color: #ffffff;
}
.ts-submit-btn:disabled {
    background-color: #FF8415 !important;
    color: #ffffff !important;
    opacity: 0.6;
}

/* Boutons connexion sociale */
.social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 45px;
    background: var(--bg-primary);
    border: 1px solid #555570;
    border-radius: 6px;
    cursor: pointer;
    padding: 0 12px;
    transition: border-color 0.2s;
}
.social-btn:hover { border-color: var(--accent); }

.social-icon-wrapper {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.social-icon-wrapper img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
/* Facebook SVG a un viewBox 560x400 (non carré) — on compense */
img.facebook-icon-svg {
    width: 44px !important;
    height: 32px !important;
    object-fit: fill !important;
    margin: 0 !important;
    position: static !important;
}
.social-btn .btn-text {
    color: #ffffff;
    font-size: 11px;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

/* --- Colonne principale --- */
.col-md-12 {
    background-color: transparent !important;
}

/* --- Sidebar (panneau filtres) --- */
.col-md-2 {
    padding: 24px 16px;
    background-color: var(--bg-secondary) !important;
    border-radius: 10px;
}

.col-md-2 h4 {
    margin-bottom: 14px;
    font-size: 18px;
}

.col-md-2 a {
    color: #B0BAC5 !important;
}

.col-md-2 a:hover {
    color: #ffffff !important;
}

.col-md-2 .panel,
.col-md-2 .panel-default,
.col-md-2 .well {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

/* --- Server header panel (nouveau layout) --- */
#server-header-panel {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

#server-header-panel .panel-body {
    padding: 12px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent !important;
    border: none !important;
    position: relative;
}


.server-header-layout {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 20px;
}

.server-header-fav {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 4px;
}

.server-header-icon {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

.server-header-icon img {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

.server-header-info {
    flex: 1;
    min-width: 0;
}


.server-header-name {
    flex: 1;
    min-width: 0;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    padding-bottom: 10px;
}

/* Bouton cœur inline (à côté du nom) */
.server-fav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.15s;
    position: relative;
}

.server-fav-btn:hover {
    transform: scale(1.15);
}

.server-fav-btn::after {
    content: attr(title);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    font-family: inherit;
    line-height: 1.4;
}

.server-fav-btn:hover::after {
    opacity: 1;
}

/* Override glyphicon → FA6 heart */
.server-fav-btn .glyphicon-heart-empty,
.server-fav-btn .glyphicon-heart {
    font-family: 'Font Awesome 6 Free' !important;
    font-size: 34px;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

.server-fav-btn .glyphicon-heart-empty::before {
    content: '\f004';
    font-weight: 400;
    color: #ef4444;
}

.server-fav-btn .glyphicon-heart::before {
    content: '\f004';
    font-weight: 900;
    color: #ef4444;
}

.server-header-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 10px;
    line-height: 1.6;
    padding-top: 10px;
    word-break: break-word;
}
@media (min-width: 360px) and (max-width: 700px) {
    .server-header-desc {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.server-header-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Icône + titre au-dessus de la description (mobile + tablette), jusqu'à la
   première résolution desktop. Au-delà, l'icône repasse à gauche du texte. */
@media (max-width: 991px) {
    #server-header-panel { position: relative; }
    .server-header-layout {
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 8px 12px;
    }
    .server-header-fav { position: absolute; top: 2px; right: 10px; grid-area: auto; }
    /* display:contents rend les enfants de server-header-info des grid items directs */
    .server-header-info { display: contents; }
    .server-header-name {
        grid-column: 2;
        grid-row: 1;
        padding-right: 36px;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    .server-header-desc {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-top: 0;
        margin-bottom: 4px;
    }
    .server-header-tags {
        grid-column: 1 / -1;
        grid-row: 3;
        margin-top: 0;
        margin-bottom: 0;
    }
}

.server-header-tag {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: border-color 0.15s, color 0.15s;
}

.server-header-tag:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

/* Méta : adresse / statut / date */
.server-header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
    /* padding-top: 10px; */
    /* border-top: 1px solid var(--border); */
}

.server-header-meta .nav-link--connect {
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    border-radius: 8px !important;
    color: #fff !important;
    padding: 6px 14px !important;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.server-header-meta .nav-link--connect:hover {
    background: #c96e0e !important;
    border-color: #c96e0e !important;
    color: #fff !important;
    text-decoration: none;
}

.server-header-meta .nav-link--connect.admin {
    background: #6c757d !important;
    border-color: #6c757d !important;
}

.server-header-meta .nav-link--connect.admin:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
}


.server-header-address {
    color: var(--text-muted);
    font-size: 13px;
}

.server-header-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.sh-status--online {
    color: #22c55e;
    font-weight: 600;
    font-size: 13px;
}

.sh-status--offline {
    color: #ef4444;
    font-weight: 600;
    font-size: 13px;
}


/* --- Server page sidebar (col-md-3) --- */
.ts-server-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ts-server-sidebar .ts-vote-card {
    margin-bottom: 0;
}
.ts-server-sidebar .panel,
.ts-server-sidebar .panel-default,
.ts-server-sidebar .well {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
    margin-bottom: 0;
}
.ts-server-sidebar h4 {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    /* margin-top: 20px; */
    margin-bottom: 10px;
}
.ts-server-sidebar .list-group-item {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}
.ts-server-sidebar .list-group-item:hover {
    background-color: var(--card-hover) !important;
    color: var(--text-primary) !important;
}
.ts-server-sidebar .list-group-item-success,
.ts-server-sidebar a[style*="background-color:#5cb85c"] {
    background-color: #166534 !important;
    border-color: #16a34a !important;
    color: #fff !important;
}
.ts-server-sidebar .nav-tabs > li > a {
    color: var(--text-muted) !important;
    background-color: transparent !important;
    border-color: transparent !important;
}
.ts-server-sidebar .nav-tabs > li.active > a,
.ts-server-sidebar .nav-tabs > li.active > a:hover {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) var(--border) transparent !important;
    color: var(--text-primary) !important;
}
.ts-server-sidebar .nav-tabs {
    border-color: var(--border) !important;
}
.ts-server-sidebar .label-top10 {
    background-color: var(--bg-primary);
    color: var(--text-muted);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
}

/* --- Top Votes card --- */
.ts-vote-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 10px 10px;
    margin-bottom: 16px;
}
.ts-vote-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.ts-vote-tabs {
    display: flex;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    gap: 6px;
    border-bottom: none !important;
}
.ts-vote-tabs li a {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted) !important;
    background: transparent;
    border: none !important;
    text-decoration: none;
}
.ts-vote-tabs li a:hover {
    color: var(--accent) !important;
}
.ts-vote-card .ts-vote-tabs li.active a,
.ts-vote-card .ts-vote-tabs li.active a:hover,
.ts-mobile-topvote-list .ts-vote-tabs li.active a,
.ts-mobile-topvote-list .ts-vote-tabs li.active a:hover {
    background-color: #000 !important;
    color: var(--text-primary) !important;
    border: none !important;
}
.ts-vote-tabs li a:focus,
.ts-vote-tabs li a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
.ts-vote-list {
    margin: 4px 0;
}

/* --- Bouton donation sidebar — texte long selon la langue --- */
.panel .btn-group.btn-group-justified {
    display: block;
    width: 100%;
}
.panel .btn-group.btn-group-justified .btn {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-size: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* --- Donation panel tabs (Ce mois / Derniers / Tous) --- */
.ts-donation-tabs {
    display: flex;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    gap: 6px;
    border-bottom: none !important;
}
.ts-donation-tabs li a {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted) !important;
    background: transparent;
    border: none !important;
    text-decoration: none;
}
.ts-donation-tabs li.active a,
.ts-donation-tabs li a:hover {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: none !important;
}
.ts-vote-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    color: var(--text-primary);
}
.ts-vote-row:last-child {
    border-bottom: none;
}
.ts-vote-medal {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}
.ts-vote-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 1.5px solid var(--border);
    font-size: 15px;
    line-height: 1;
    padding: 0;
    transform: translateY(-1px);
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}
.ts-vote-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ts-vote-count {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}
.ts-vote-footer {
    display: flex;
    gap: 8px;
}
.ts-vote-tabs ~ .ts-vote-footer {
    margin-top: 14px;
}
.ts-vote-mobile-action {
    display: none;
}
.ts-mobile-vote-row {
    display: none;
}
/* .ts-mobile-vote-row est désormais rendu directement en PHP (server.php,
   juste après #server-header-panel) ; caché par défaut (desktop), affiché
   uniquement mobile+tablette ci-dessous. */
.ts-mobile-vote-row { display: none; }
@media (max-width: 991px) {
    /* La sidebar garde son propre Vote/Copy IP (desktop) ; on les cache ici
       car ils sont dupliqués en haut de page via .ts-mobile-vote-row. */
    .ts-server-sidebar .ts-vote-card,
    .ts-server-sidebar .ts-vote-mobile-action {
        display: none;
    }
    .ts-mobile-vote-row {
        display: flex;
        gap: 8px;
        align-items: stretch;
        margin-top: 12px;
    }
    .ts-mobile-vote-row .ts-vote-card {
        flex: 1;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
    }
    .ts-mobile-vote-row .ts-vote-title { display: none; }
    .ts-mobile-topvote-list {
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 10px;
        margin-top: 8px;
    }
    .ts-mobile-vote-row .ts-vote-card .ts-vote-btn {
        border-color: var(--text-muted) !important;
    }
    .ts-vote-mobile-action {
        display: flex;
        flex: 1;
    }
    .ts-vote-mobile-action .ts-vote-btn {
        width: 100%;
        background: var(--accent) !important;
        border-color: var(--accent) !important;
        color: #fff !important;
    }
    .ts-vote-mobile-action .ts-vote-btn:hover {
        background: #c96e0e !important;
        border-color: #c96e0e !important;
        color: #fff !important;
    }
    .ts-vote-mobile-action .ts-vote-btn--copy {
        background: #16a34a !important;
        border-color: #16a34a !important;
    }
    .ts-vote-mobile-action .ts-vote-btn--copy:hover {
        background: #15803d !important;
        border-color: #15803d !important;
    }
    .ts-vote-mobile-action .ts-vote-btn--offline {
        background: #ef4444 !important;
        border-color: #ef4444 !important;
    }
    .ts-vote-mobile-action .ts-vote-btn--offline:hover {
        background: #dc2626 !important;
        border-color: #dc2626 !important;
    }
    .ts-vote-mobile-action .ts-vote-btn--discord {
        background: #5865F2 !important;
        border-color: #5865F2 !important;
    }
    .ts-vote-mobile-action .ts-vote-btn--discord:hover {
        background: #4752c4 !important;
        border-color: #4752c4 !important;
    }
}
.ts-vote-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    padding: 4px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--accent);
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: background 0.2s;
}
.ts-vote-btn:hover {
    background-color: #c96e0e;
    text-decoration: none;
    color: var(--text-primary) !important;
}

/* --- Bulle de survol custom (chart_default.php / canvas_votes_number) --- */
.ts-chart-tooltip {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    transform: translateY(-50%);
    background: rgba(22, 24, 28, 0.92);
    border: 1px solid #2a2a42;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #ffffff;
    white-space: nowrap;
    pointer-events: none;
}
.ts-chart-tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
}
.ts-chart-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ts-chart-tooltip-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex: none;
}
.ts-chart-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    margin-top: -6px;
    border: 6px solid transparent;
}
.ts-chart-tooltip--right::after {
    left: 100%;
    border-left-color: #2a2a42;
}
.ts-chart-tooltip--right::before {
    content: '';
    position: absolute;
    top: 50%;
    margin-top: -5px;
    left: 100%;
    margin-left: -1px;
    border: 5px solid transparent;
    border-left-color: rgba(22, 24, 28, 0.92);
    z-index: 1;
}
.ts-chart-tooltip--left::after {
    right: 100%;
    border-right-color: #2a2a42;
}
.ts-chart-tooltip--left::before {
    content: '';
    position: absolute;
    top: 50%;
    margin-top: -5px;
    right: 100%;
    margin-right: -1px;
    border: 5px solid transparent;
    border-right-color: rgba(22, 24, 28, 0.92);
    z-index: 1;
}

/* --- Sidebar generic card (Server Options, Categories) --- */
.ts-sidebar-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.ts-sidebar-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.ts-sidebar-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 8px;
    border-radius: 6px;
    color: var(--text-primary) !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.ts-sidebar-option .fa,
.ts-sidebar-option .glyphicon {
    width: 16px;
    flex-shrink: 0;
    text-align: center;
}
.ts-sidebar-option:last-child { border-bottom: none; }
.ts-sidebar-option:hover {
    background-color: var(--card-hover);
    text-decoration: none;
    color: var(--text-primary) !important;
}
.ts-sidebar-option--green {
    color: #4ade80 !important;
}
.ts-sidebar-option--green:hover {
    color: #4ade80 !important;
}
.ts-sidebar-option--active {
    color: #f87171 !important;
}

/* --- Liste catégories sidebar --- */
.ts-cat-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    margin-top: 26px;
    padding-left: 0;
}

.ts-cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ts-cat-item {
    display: block;
    color: var(--text-primary) !important;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 0;
    text-decoration: none;
    border: none;
    background: none;
    transition: color 0.15s;
}

.ts-cat-item:hover {
    color: var(--accent) !important;
    text-decoration: none;
}

.ts-cat-active {
    color: var(--accent) !important;
    font-weight: 700;
}

.ts-cat-sub {
    font-size: 15px;
    padding-left: 12px;
    color: var(--text-muted) !important;
}

.col-md-2 input.form-control {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

/* --- Cartes serveurs (fond + texte) --- */
.panel.panel-default,
.panel-body {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

.panel a { color: var(--text-primary) !important; }
.panel a:hover { color: var(--accent) !important; }

/* Pages claim — <FONT color='blue'> hardcodé dans les fichiers de langue */
.panel-body font[color=blue] { color: var(--accent) !important; }
.panel-body font[color=Blue] { color: var(--accent) !important; }
.panel-body font[color="#428bca"] { color: var(--accent) !important; }

/* --- Tables dans les panels --- */
.panel table { width: 100%; }

/* =============================================
   SECTION HÉRO (page d'accueil)
   ============================================= */
.ts-hero {
    /* background-color: var(--bg-nav); */
    /* border-bottom: 1px solid var(--border); */
    padding: 50px 20px 2px;
    text-align: center;
    /* margin-bottom: 4px; */
}

.ts-hero-tagline {
    color: var(--text-primary);
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 36px;
}

.ts-hero-desc {
    color: var(--text-muted);
    font-size: 20px;
    margin: 0px auto 30px;
    line-height: 1.5;
}

.ts-hero-content {
    display: inline-block;
    text-align: center;
    max-width: 100%;
}

.ts-hero-counters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    width: 100%;
}

.ts-hero-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 30px;
    border-radius: 12px;
    background: var(--bg-secondary);
    flex: 1;
    flex-shrink: 0;
}

.ts-hero-counter-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.ts-hero-counter-label {
    font-size: 21px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mise en avant "Palworld - New" temporaire — voir bloc de commentaire ligne ~2313 pour l'annuler */
.ts-hero-new-game {
    display: flex;
    width: calc((100% - 32px) / 3);
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: -20px auto 12px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    background: var(--bg-secondary);
    text-decoration: none !important;
    transition: transform 0.15s, box-shadow 0.15s;
}

.ts-hero-new-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(232, 134, 26, 0.35);
}

.ts-hero-new-game-icon {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.ts-hero-new-game-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
    white-space: normal;
}

.ts-hero-new-game-tag {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 4px;
}


.ts-hero-search {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.ts-hero-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

.ts-hero-search input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.ts-hero-search input:focus {
    border-color: var(--accent);
}

.ts-hero-search input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
    font-style: italic;
}

.ts-search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ts-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

.ts-search-item:last-child {
    border-bottom: none;
}

.ts-search-item:hover,
.ts-search-item.ts-active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.ts-search-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

/* =============================================
   FILTRES AJAX — état chargement
   ============================================= */
#ts-servers-wrapper {
    transition: opacity 0.2s;
}

#ts-servers-wrapper.ts-loading {
    opacity: 0.35;
}

/* =============================================
   GRILLE DES JEUX (page d'accueil)
   ============================================= */
.ts-games-container {
    padding-top: 40px;
    padding-bottom: 40px;
}

.ts-games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Carte d'un jeu */
.ts-game-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    position: relative;
    z-index: 0;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.ts-game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    pointer-events: none;
    transition: none;
}

.ts-game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(232, 134, 26, 0.18), 0 2px 8px rgba(0,0,0,0.3);
}

.ts-game-card:hover::after {
    animation: card-shine 0.7s ease forwards;
}

@keyframes card-shine {
    0%   { left: -75%; }
    100% { left: 125%; }
}

/* Bannière en haut de la carte */
.ts-game-banner {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.ts-game-banner {
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
}

[data-game="rust-server"] .ts-game-banner {
    background-position: center 50%;
}

[data-game="v-rising-server"] .ts-game-banner {
    background-position: 45%;
}

[data-game="life-is-feudal-server"] .ts-game-banner {
    background-position: center 0%;
}

[data-game="conan-exiles-server"] .ts-game-banner {
    background-position: center 0%;
}

[data-game="miscreated-server"] .ts-game-banner {
    background-position: center 50%;
}

[data-game="discord-server"] .ts-game-banner {
    background-size: contain !important;
    background-position: center center;
    background-color: #414eec;
}

[data-game="redm-server"] .ts-game-banner {
    background-position: center 45%;
}

[data-game="squad-server"] .ts-game-banner {
    background-size: 100%;
    background-position: 45% 100%;
}

/* ============================================================
   MISE EN AVANT "PALWORLD - NEW" (temporaire)
   Le jour où Palworld n'est plus un nouveau jeu, retirer les 5 blocs suivants :
   1. html/pages/home.php            — le bloc "if ($cat->url === 'palworld-server')" (ruban .ts-game-card-ribbon)
   2. html/pages/submit.php          — le bloc "if ($category->name == "Palworld")" (texte "- New" + couleur orange)
   3. html/pages/category.php        — le bloc "if ($_s->name == "Palworld")" (badge .cat-sidebar-badge-new)
   4. html/template/includes/widgets/categories.php — le bloc "if ($_g->name == "Palworld")" (badge .cat-sidebar-badge-new)
   5. html/template/overall_header.php — le lien "<a ... class="ts-hero-new-game">" juste après le compteur "players"
   Les classes CSS ci-dessous (.ts-game-card-ribbon, .cat-sidebar-badge-new, .ts-hero-new-game*) peuvent
   être supprimées aussi à ce moment-là, ou laissées telles quelles (inutilisées, sans impact).
   Les clés de traduction new_badge / new_game_tag / new_game_headline (html/languages/*.php,
   section $language['misc']) peuvent aussi être supprimées, sans impact si laissées en place.
   ============================================================ */

/* Ruban diagonal "nouveau jeu" dans le coin supérieur gauche de la carte */
.ts-game-card-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.ts-game-card-ribbon span {
    position: absolute;
    top: 12px;
    left: -45px;
    width: 150px;
    transform: rotate(-45deg);
    text-align: center;
    background: linear-gradient(135deg, #f59e0b, #e8861a);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Icône du jeu — cercle à gauche du titre */
.ts-game-icon {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background-color: #1F2125;
    flex-shrink: 0;
    /* border: 3px solid transparent;
    background-color: transparent; */
    object-fit: cover;
}

/* Infos en bas de la carte */
.ts-game-info {
    padding: 16px;
}

.ts-game-info-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.ts-game-info-text {
    min-width: 0;
    flex: 1;
}

.ts-game-name {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts-game-desc {
    color: var(--text-primary) !important;
    font-size: 12px;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ts-game-meta {
    display: flex;
    justify-content: space-between;
}

.ts-game-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border-radius: 8px;
    padding: 8px 14px 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background-color: #34363c;
}

.ts-game-stat i {
    color: var(--text-muted);
    font-size: 14px;
}

.ts-game-meta i {
    margin-right: 5px;
}

/* Responsive : 2 colonnes sur tablette, 1 sur mobile */
@media (max-width: 900px) {
    .ts-games-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .ts-games-grid { grid-template-columns: 1fr; }
    .ts-hero-tagline { font-size: 22px; }
    .ts-hero-content { display: block; width: 100%; }
    .ts-hero-counters { flex-direction: column; gap: 10px; }
    .ts-hero-counter { padding: 14px 20px; width: 75%; }
    .ts-hero-counter-value { font-size: 24px; }
    .ts-hero-search { width: 100%; box-sizing: border-box; }
    .ts-hero { padding-left: 0; padding-right: 0; }
    .ts-hero-new-game { width: 75%; margin: -14px auto 17px; padding: 8px 12px; }
    .ts-hero-new-game-icon { width: 30px; height: 30px; }
    .ts-hero-new-game-text { white-space: normal; font-size: 12px; }
}

/* =============================================
   SCROLLBAR (navigateurs Webkit)
   ============================================= */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
::-webkit-scrollbar {
    width: 11px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
    background-clip: padding-box;
}

/* --- Menu burger ouvert — alignement gauche (mobile uniquement) --- */
.collapsing {
    transition-duration: 0.15s !important;
}
@media (max-width: 991px) {
    #navbarContent:not(.show) {
        display: none !important;
    }
    #navbarContent.show {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-nav);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 14px 20px 20px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        z-index: 1029;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    #navbarContent .navbar-nav {
        padding: 8px 0;
        width: 100%;
        align-items: flex-start !important;
    }
    #navbarContent .navbar-nav .nav-item {
        width: 100%;
    }
    #navbarContent .navbar-nav .nav-link {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
    #navbarContent .navbar-nav .nav-item .ts-login-btn {
        display: inline-block;
        margin: 6px 0;
    }
    /* Login en dernier sur mobile */
    #navbarContent .navbar-nav {
        display: flex;
        flex-direction: column;
    }
    #navbarContent .navbar-nav .nav-item:has(.ts-login-btn) {
        order: 999;
        margin-top: 8px;
    }
    /* Sous-menus dropdown dans le burger */
    #navbarContent .dropdown-menu {
        position: static !important;
        float: none !important;
        background-color: var(--bg-primary) !important;
        border: none !important;
        border-radius: 6px !important;
        box-shadow: none !important;
        margin: 4px 0 8px 12px !important;
        padding: 4px 0 !important;
        width: auto !important;
    }
    #navbarContent .dropdown-menu.show {
        display: inline-flex !important;
        flex-direction: column !important;
    }
    #navbarContent .dropdown-menu > li > a,
    #navbarContent .dropdown-menu .dropdown-item {
        padding: 9px 16px !important;
        font-size: 14px !important;
        color: var(--text-muted) !important;
        border-radius: 0 !important;
    }
    #navbarContent .dropdown-menu > li > a:hover,
    #navbarContent .dropdown-menu .dropdown-item:hover {
        background-color: rgba(255,255,255,0.05) !important;
        color: var(--text-primary) !important;
    }
}

/* --- Bouton hamburger (mobile) --- */
.navbar-toggler {
    border: 1px solid #9090b0 !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    transition: border-color 0.2s, background-color 0.2s;
}
.navbar-toggler:hover,
.navbar-toggler:focus {
    border-color: var(--accent) !important;
    background-color: rgba(232, 134, 26, 0.1) !important;
    box-shadow: none !important;
    outline: none !important;
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23b8b8d0' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
    transition: background-image 0.2s;
}
/* Croix quand le menu est ouvert */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' d='M6 6l18 18M24 6L6 24'/%3E%3C/svg%3E") !important;
}

/* --- Bouton Login navbar --- */
.btn.ts-login-btn i {
    margin-right: 5px;
}

.btn.ts-login-btn {
    font-size: 13px;
    background-color: var(--accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    /* padding-top: 0 !important;
    padding-bottom: 0 !important; */
    padding: 8px 8px !important;
    line-height: unset !important;
    transition: background-color 0.2s, transform 0.1s;
}
.btn.ts-login-btn:hover,
.btn.ts-login-btn:focus {
    background-color: color-mix(in srgb, var(--accent) 80%, #000) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* --- Purchase highlight : icônes de paiement --- */
.payment-icon {
    margin: 0 5px;
}

/* =============================================
   MODERN SERVER CARDS GRID
   ============================================= */

.server-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.server-card {
    flex: 0 1 calc(50% - 8px);
    min-width: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.server-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    pointer-events: none;
    transition: none;
}

.server-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(232, 134, 26, 0.3);
}

.server-card:hover::after {
    animation: card-shine 0.7s ease forwards;
}

.server-card--premium {
    box-shadow: 0 0 10px rgba(232, 134, 26, 0.25);
}

.server-card--premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #c2410c);
    z-index: 2;
}

.server-card--highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #38bdf8);
    z-index: 2;
}

.server-card--highlight {
    box-shadow: 0 0 28px rgba(255, 200, 60, 0.10), inset 0 0 80px rgba(255, 200, 60, 0.04);
}

/* Banner */
.server-card-banner-link {
    display: block;
    text-decoration: none !important;
}

.server-card-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    background: #1c1e24;
    flex-shrink: 0;
}

.server-card-banner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

/* Anciennes images : centrées sur fond noir, pas de zoom */
.server-card-banner-user-img {
    object-fit: contain !important;
    object-position: center center !important;
    background-color: #0d0d0d !important;
    width: 100%;
    height: 100%;
}

/* Nouvelles images (préfixe v2_) : cover plein cadre */
.server-card-banner-user-img-v2 {
    object-fit: cover;
    object-position: center center;
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease;
    display: block;
}

.server-card:hover .server-card-banner > img:not(.server-card-banner-user-img):not(.server-card-banner-discord-icon-bg):not(.server-card-banner-discord-icon) {
    transform: scale(1.04);
}

.server-card-banner-placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.server-card:hover .server-card-banner-placeholder-img {
    transform: scale(1.04);
}

/* Discord : logo centré sur fond bleu (même rendu que ts-game-banner) */
.cat-discord-server-server .server-card-banner {
    background-color: #414eec;
}
.cat-discord-server-server .server-card-banner-placeholder-img {
    object-fit: contain;
    object-position: center center;
    background-color: #414eec;
}

/* Icône Discord réutilisée comme bannière : fond flouté zoomé (comble le cadre large) + icône nette entière centrée par-dessus, non recadrée */
.server-card-banner .server-card-banner-discord-icon-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.55);
    transform: scale(1.2);
}
.server-card-banner .server-card-banner-discord-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

/* Hauteurs placeholder par catégorie */
.cat-dayz-server-server            .server-card-banner-placeholder-img { height: 120%; }
.cat-space-engineers-server .server-card-banner-placeholder-img { height: 120%; }
.cat-ark-survival-ascended-server-server .server-card-banner-placeholder-img { height: 140%; }
.cat-squad-server           .server-card-banner-placeholder-img { height: 140%; }
.cat-maplestory-private-server-server .server-card-banner-placeholder-img { height: 125%; }
.cat-life-is-feudal-server-server  .server-card-banner-placeholder-img { height: 150%; }
.cat-conan-exiles-server-server    .server-card-banner-placeholder-img { height: 150%; }

/* Banner overlay badges */
.server-card-banner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.server-card-banner-overlay a,
.server-card-banner-overlay span[onclick] {
    pointer-events: all;
}

.server-card-banner-badges {
    position: absolute;
    top: 12px;
    right: 8px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.server-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: auto;
    height: 22px;
    padding: 0 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.server-card-badge:hover { transform: scale(1.06); opacity: 0.9; }

.server-card-badge--premium {
    background: linear-gradient(135deg, rgba(232, 134, 26, 0.92), rgba(245, 158, 11, 0.85));
    color: #fff;
    box-shadow: 0 2px 8px rgba(232, 134, 26, 0.40);
    border: 1px solid rgba(255, 190, 80, 0.35);
}

.server-card-badge--highlight {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.92), rgba(37, 99, 235, 0.85));
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.40);
    border: 1px solid rgba(37, 99, 235, 0.40);
}

.server-card-badge--country {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.server-card-badge--admin {
    background: rgba(66, 139, 202, 0.85);
    color: #fff;
    cursor: pointer;
}

/* Card body */
.server-card-body {
    padding: 14px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

/* Icon + name header */
.server-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.server-card-icon {
    width: 66px;
    height: 66px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.08);
    background: #1c1e24;
}

.server-card-icon--cat {
    /* padding: 8px; */
    background: transparent;
    /* opacity: 0.7; */
}

.server-card-title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.server-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.server-card-title-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.server-card-country-flag {
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.15s;
    line-height: 1;
    display: inline-flex;
    text-decoration: none !important;
    outline: none;
}

.server-card-country-flag:hover {
    opacity: 1;
}

.server-card-country-flag .fi {
    width: 24px;
    height: 18px;
    background-size: cover;
    display: block;
    outline: none;
    border: 0;
    box-shadow: none;
}

/* Drapeaux dans le filtre pays (page catégorie) */
.fi-country-filter {
    width: 32px;
    height: 24px;
    background-size: cover;
    display: inline-block;
    vertical-align: middle;
}

.server-card-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-card-title a {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.server-card-title a:hover {
    color: var(--accent) !important;
}

.server-card-edit-link {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    font-size: 11px;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    background: rgba(0,0,0,0.55);
    padding: 2px 7px;
    border-radius: 4px;
}

.server-card-edit-link:hover {
    color: var(--accent) !important;
}

/* Description */
.server-card-desc {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* IP row */
.server-card-ip-row {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* On rend le wrapper Bootstrap transparent :
   ses enfants deviennent des flex items directs de .server-card-ip-row */
.server-card-ip-group {
    display: contents !important;
}

.server-card-ip-row .input-group-addon {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    position: static !important;
    z-index: auto !important;
    float: none !important;
    font-size: 11px;
    padding: 0 10px;
    height: 28px;
    white-space: nowrap;
    background: var(--bg-secondary) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-right: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 6px 0 0 6px !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
}

/* Connect → vert moderne */
.server-card-ip-row .input-group-addon:not(.copy-btn) {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    color: #4ade80 !important;
}

/* Copy → rouge moderne */
.server-card-ip-row .input-group-addon.copy-btn {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
}

/* Copy mais serveur en ligne (Minecraft, Palworld, Scum, IP masquée...) → vert,
   comme Connect. Sans ça le badge reste rouge sur desktop meme quand le
   serveur est online (le variant vert n'existait qu'en @media mobile). */
.server-card-ip-row .input-group-addon.copy-btn.copy-btn--online {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    color: #4ade80 !important;
}

.server-card-ip-row .form-control {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    float: none !important;
    position: static !important;
    z-index: auto !important;
    margin: 0 !important;
    font-size: 11.5px !important;
    height: 28px !important;
    padding: 3px 8px !important;
    border-radius: 0 6px 6px 0 !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    background: rgba(255,255,255,0.04) !important;
    color: var(--text-primary) !important;
    font-family: monospace;
    margin-right: 6px !important;
}

.server-card-inactive {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Info badge (wipe, map, gametime) */
.server-card-info-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 4px;
    font-size: 10.5px;
    padding: 0 8px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

/* Footer: tags + stats */
.server-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}

.server-card-tags-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.server-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.server-card-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border: 1px solid rgba(255,255,255,0.07);
}

.server-card-tag:hover,
a:hover .server-card-tag {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.server-card-tag--primary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,0.07) !important;
}

.server-card-tag--primary:hover,
a:hover .server-card-tag--primary {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
}

.server-card-stats {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
    margin-right: 4px;
}

.server-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.server-card-stat i {
    color: var(--text-muted);
    font-size: 12px;
}

.server-card-mobile-copy {
    display: none !important;
}

/* Responsive: 1 column on small screens */
@media (max-width: 767px) {
    .server-card {
        flex: 1 1 100%;
        min-width: 0;
    }
    .server-card-banner {
        aspect-ratio: 16 / 7;
    }
}

/* =============================================
   CATEGORY PAGE LAYOUT  (sidebar + main)
   ============================================= */

.category-page-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    grid-template-areas:
        "hero    hero"
        "partner partner"
        "ads     ads"
        "sidebar main";
    column-gap: 20px;
    row-gap: 0;
}

/* --- Sidebar --- */
.cat-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
    scrollbar-width: none;
}
.cat-sidebar::-webkit-scrollbar { display: none; }
.cat-sidebar-games-list::-webkit-scrollbar { width: 3px; }
.cat-sidebar-games-list::-webkit-scrollbar-track { background: transparent; }
.cat-sidebar-games-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.cat-sidebar-games-list:hover::-webkit-scrollbar-thumb { background: var(--border); }

/* Chaque boîte séparée */
.cat-sidebar-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 12px;
    /* margin-bottom: 16px; */
}

.cat-sidebar-publift {
    width: 100%;
    display: contents;
    padding: 0;
}
.cat-sidebar-publift .publift-slot {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.cat-sidebar-publift .publift-slot-empty {
    display: none;
}
.cat-sidebar-publift:has(.publift-slot-empty) {
    display: none !important;
}
.cat-sidebar-publift.publift-slot-empty {
    display: none !important;
}
.server-sidebar-publift {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.server-sidebar-publift.publift-slot-filled {
    height: auto !important;
    overflow: visible !important;
}
.server-sidebar-publift.publift-slot-empty {
    display: none !important;
}

.cat-sidebar-ad {
    width: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.02),
        rgba(255,255,255,0.02) 10px,
        transparent 10px,
        transparent 20px
    );
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.5px;
}
.cat-sidebar-ad::after {
    content: 'Publicité';
}

.cat-main-ad {
    width: 100%;
    display: none !important;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    margin-bottom: 24px;
    border: 2px dashed var(--accent);
    border-radius: 8px;
    background: rgba(232, 134, 26, 0.06);
}
.cat-main-ad::after {
    content: 'Publicité — visible ici en production';
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cat-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 10px 0;
    padding: 5px;
    /* border-bottom: 1px solid var(--text-muted); */
}
.cat-sidebar-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.cat-sidebar-arrow {
    font-size: 15px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}
.cat-sidebar-box.collapsed .cat-sidebar-arrow {
    transform: rotate(180deg);
}
.cat-sidebar-box.collapsed .cat-sidebar-title {
    margin-bottom: 0;
}
.cat-sidebar-collapse {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}
.cat-sidebar-box.collapsed .cat-sidebar-collapse {
    max-height: 0;
    opacity: 0;
}

/* Subcategory links (with icon) */
.cat-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}
.cat-sidebar-item:hover { background: var(--card-hover); color: var(--text-primary); text-decoration: none; }
.cat-sidebar-item:focus,
.cat-sidebar-item:focus-visible { outline: none !important; box-shadow: none !important; }
.cat-sidebar-item--active { background: var(--card-hover); color: var(--accent) !important; font-weight: 600; outline: none !important; box-shadow: none !important; text-decoration: none !important; }
.cat-sidebar-item--active:hover,
.cat-sidebar-item--active:focus,
.cat-sidebar-item--active:focus-visible { background: var(--card-hover); color: var(--accent) !important; text-decoration: none !important; outline: none !important; box-shadow: none !important; }
.cat-sidebar-item img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Games list */
.cat-sidebar-games-list {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

/* Sur la page serveur, la sidebar a assez de place : pas de scroll interne */
.ts-server-sidebar .cat-sidebar-games-list {
    max-height: none;
    overflow-y: visible;
}

.cat-sidebar-game {
    display: block;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-sidebar-game:hover { background: var(--card-hover); color: var(--text-primary); text-decoration: none; }
.cat-sidebar-game--active { color: var(--accent); font-weight: 600; }
.cat-sidebar-game--active:hover { color: var(--accent); }

/* Mise en avant "Palworld - New" temporaire — voir bloc de commentaire ligne ~2313 pour l'annuler */
.cat-sidebar-badge-new {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: 2px;
}

/* --- Main column --- */
.cat-main { grid-area: main; min-width: 0; }

/* --- Game hero header --- */
.cat-hero {
    grid-area: hero;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto 20px auto;
    gap: 10px;
}
.cat-hero-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}
.cat-hero-ads {
    grid-area: ads;
    margin-bottom: 16px;
}
.cat-partner-banner {
    grid-area: partner;
    margin: 0 auto 12px;
    width: min(680px, 100%);
}
.cat-partner-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    min-height: 44px;
    padding: 7px 16px;
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(100deg, rgba(232, 134, 26, 0.24), var(--bg-secondary) 72%);
    border: 1px solid rgba(232, 134, 26, 0.75);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.cat-partner-link:hover {
    color: var(--text-primary);
    text-decoration: none;
    border-color: var(--accent);
    background: linear-gradient(100deg, rgba(232, 134, 26, 0.34), var(--bg-secondary) 72%);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.26);
    transform: translateY(-1px);
}
.cat-partner-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.cat-partner-logo {
    width: 136px;
    height: 25px;
    object-fit: contain;
    flex: 0 0 auto;
}
.cat-partner-link > span {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.cat-partner-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
    padding: 6px 10px;
    color: #fff !important;
    background: var(--accent);
    border-radius: 5px;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap;
}
.cat-partner-link:hover .cat-partner-cta { background: #f39a2b; }

.cat-partner-link,
.cat-partner-link:link,
.cat-partner-link:visited,
.cat-partner-link:hover,
.cat-partner-link:focus,
.cat-partner-link:active,
.tip4serv-promo-link,
.tip4serv-promo-link:link,
.tip4serv-promo-link:visited,
.tip4serv-promo-link:hover,
.tip4serv-promo-link:focus,
.tip4serv-promo-link:active {
    text-decoration: none !important;
}

/* --- Tip4Serv promotion on server submission forms --- */
.tip4serv-promo { margin: 0 0 24px; }
.tip4serv-promo-link {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 82px;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(100deg, rgba(232, 134, 26, 0.2), var(--bg-secondary) 76%);
    border: 1px solid rgba(232, 134, 26, 0.7);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.tip4serv-promo-link:hover {
    color: var(--text-primary);
    text-decoration: none;
    border-color: var(--accent);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}
.tip4serv-promo-image {
    width: 108px;
    height: 60px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 5px;
}
.tip4serv-promo-copy {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}
.tip4serv-promo-copy strong { color: var(--text-primary); font-size: 16px; line-height: 1.3; }
.tip4serv-promo-copy span { color: var(--text-muted); font-size: 13px; line-height: 1.35; }
.tip4serv-promo-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 11px;
    color: #fff !important;
    background: var(--accent);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.tip4serv-promo-link:hover .tip4serv-promo-cta { background: #f39a2b; }

.cat-hero-logo {
    align-self: stretch;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    flex-shrink: 0;
}
.cat-hero-text { min-width: 0; }
.cat-hero-text h1 { font-size: 44px; font-weight: 700; margin: 0 0 20px 0; color: var(--text-primary); line-height: 1.2; }
.cat-hero-text h2 { font-size: 16px; color: var(--text-muted); margin: 0; font-weight: 400; }
.cat-hero-desc {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
    text-align: left;
    padding-left: 0;
}

/* --- Horizontal filter bar --- */
.cat-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px 0 10px;
    margin-bottom: 10px;
    min-height: 48px;
}

.cat-filterbar-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
    height: 48px;
}
.cat-filterbar-row .cat-filter-bar {
    margin-bottom: 0;
    margin-left: 10px;
    flex: 1;
    min-width: 0;
    min-height: unset;
    height: 100%;
}
.cat-filter-search {
    position: relative;
    flex-shrink: 0;
    height: 100%;
}
.cat-filter-search .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}
.cat-filter-search input[type="text"] {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    padding: 0 12px 0 45px !important;
    width: 260px;
    height: 48px !important;
    min-height: 48px !important;
    display: block !important;
    outline: none;
    box-sizing: border-box !important;
}
.cat-filter-search input[type="text"]::placeholder { color: var(--text-muted); opacity: 0.5; font-style: italic; }
.cat-filter-search input[type="text"]:focus { border-color: var(--accent) !important; }

.cat-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 16px;
    font-family: inherit;
    padding: 8px 10px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}
.cat-filter-btn:hover,
.cat-filter-btn.open { background: transparent; color: var(--text-primary); border: none; }
.cat-filter-btn--active { color: var(--accent); border-color: var(--accent); }
.cat-filter-btn .caret { margin-left: 2px; opacity: 0.6; }
.cat-filter-btn.dropdown-toggle::after { display: none; }
.cat-active-dot {
    display: none;
    flex-shrink: 0;
}

.cat-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e55;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(220, 50, 50, 0.45);
    background: rgba(220, 50, 50, 0.08);
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}
.cat-filter-reset:hover {
    color: #ff6666;
    background: rgba(220, 50, 50, 0.15);
    border-color: rgba(220, 50, 50, 0.75);
    text-decoration: none;
}

/* × reset dans l'item actif du dropdown */
.cat-filter-bar .dropdown-menu > li.active > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cat-item-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: -6px;
    width: 26px;
    height: 26px;
    font-size: 19px;
    color: #e55;
    /* background: rgba(220, 50, 50, 0.15); */
    border-radius: 4px;
    pointer-events: none;
}

/* Dropdown menus inside filter bar */
.cat-filter-bar .dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}
.cat-filter-bar .dropdown-menu > li > a {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    display: block;
    transition: background 0.1s, color 0.1s;
    text-decoration: none !important;
}
.cat-filter-bar .dropdown-menu > li > a:hover { background: var(--card-hover); color: var(--text-primary); }
.cat-filter-bar .dropdown-menu > li.active > a,
.cat-filter-bar .dropdown-menu > li.active > a:hover { background: var(--bg-primary); color: var(--accent); font-weight: 600; }

/* --- Search bar --- */
.cat-search-bar {
    position: relative;
    margin-bottom: 14px;
}
.cat-search-bar .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}
.cat-search-bar input[type="text"] {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 11px 16px 11px 42px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
    display: block;
}
.cat-search-bar input[type="text"]::placeholder { color: var(--text-muted); }
.cat-search-bar input[type="text"]:focus { border-color: var(--accent); }

/* --- Mobile filter button & modal --- */
.cat-filter-btns-row {
    display: flex;
    gap: 10px;
}
.cat-filter-btns-row .cat-filter-mobile-btn {
    flex: 1;
    width: auto;
}
.cat-fmodal-tag-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}
.cat-tags-dropdown {
    display: none;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.cat-tags-dropdown.open { display: flex; }
.cat-tags-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none !important;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cat-tags-dropdown-item:last-child { border-bottom: none; }
.cat-tags-dropdown-item:hover { background: var(--card-hover); }
.cat-tags-dropdown-item.active { color: var(--accent); font-weight: 600; }
.cat-tags-dropdown-item .fa-check { margin-left: auto; font-size: 12px; }
.cat-tags-dropdown-reset {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #e55;
    font-size: 13px;
    text-decoration: none !important;
    border-top: 1px solid rgba(255,255,255,0.06);
    transition: background 0.12s;
}
.cat-tags-dropdown-reset:hover { background: var(--card-hover); color: #e55; }
.cat-filter-mobile-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.cat-filter-mobile-btn:hover,
.cat-filter-mobile-btn.has-active { border-color: var(--accent); color: var(--accent); }
.cat-filter-mobile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 1;
    padding: 0 3px;
}
.cat-filter-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding: 160px 12px 16px;
}
.cat-filter-modal-overlay.open { display: flex; }
.cat-filter-modal-sheet {
    width: 100%;
    max-height: 100%;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    animation: catFModalDown 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
@keyframes catFModalDown {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.cat-filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}
.cat-filter-modal-header i { color: var(--accent); margin-right: 4px; }
.cat-fmodal-header-reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    margin-right: 20px;
    font-size: 12px;
    color: #e55;
    background: none;
    border: 1px solid #e55;
    border-radius: 6px;
    padding: 3px 10px;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.cat-fmodal-header-reset:hover { background: #e55; color: #fff; }
.cat-fmodal-header-reset i { color: #e55; }
.cat-fmodal-header-reset:hover i { color: #fff; }

.cat-filter-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
}
.cat-filter-modal-close:hover { color: var(--text-primary); background: var(--card-hover); }
.cat-filter-modal-body {
    overflow-y: auto;
    padding: 14px 18px 28px;
    flex: 1;
}
.cat-fmodal-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cat-fmodal-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cat-fmodal-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-fmodal-items { display: flex; flex-direction: column; gap: 2px; }
.cat-fmodal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
}
.cat-fmodal-item:hover { background: var(--card-hover); color: var(--text-primary); }
.cat-fmodal-item.active { background: var(--bg-primary); color: var(--accent); font-weight: 600; }
.cat-fmodal-check { font-size: 12px; }
.cat-fmodal-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    justify-content: space-between;
}
.cat-fmodal-toggle:hover { opacity: 0.85; }
.cat-fmodal-chevron {
    font-size: 11px;
    transition: transform 0.22s ease;
    opacity: 0.5;
    margin-left: auto;
    flex-shrink: 0;
}
.cat-fmodal-section--collapsible.open .cat-fmodal-chevron { transform: rotate(180deg); }
.cat-fmodal-section--collapsible .cat-fmodal-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
    margin-top: 0;
}
.cat-fmodal-section--collapsible.open .cat-fmodal-items { max-height: 9999px; }
.cat-fmodal-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0 12px; }
.cat-fmodal-reset {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e55;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
}
.cat-fmodal-reset:hover { background: var(--card-hover); color: #e55; }
body.cat-fmodal-noscroll { overflow: hidden !important; }
body.cat-fmodal-noscroll > *:not(#main-navbar):not(.cat-filter-modal-overlay):not(#ts-vote-overlay):not(#ts-login-overlay) {
    filter: blur(4px);
    transition: filter 0.25s ease;
}
body > *:not(#main-navbar):not(.cat-filter-modal-overlay):not(#ts-vote-overlay):not(#ts-login-overlay) {
    transition: filter 0.25s ease;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .category-page-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "partner"
            "ads"
            "sidebar"
            "main";
    }
    .cat-sidebar { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
    .cat-sidebar .cat-sidebar-box { flex: 1 1 200px; }
    .cat-sidebar-games-list { max-height: 200px; }
}
@media (max-width: 600px) {
    .cat-sidebar { flex-direction: column; }
    .cat-sidebar .cat-sidebar-box { flex: none; }
}
@media (max-width: 767px) {
    /* Réduire l'espace entre panels sur mobile */
    .panel { margin-bottom: 8px !important; }
    .ts-server-sidebar { gap: 8px; }
    /* Spacer hardcodé entre header panel et tabs */
    #ts-server-spacer { margin-top: 12px !important; }
    .ts-vote-card { margin-bottom: 0; }
    /* Bouton connect déjà affiché à côté du vote sur mobile */
    #details_tab .nav-item:has(.nav-link--connect) { display: none; }
    /* Sur mobile : masquer uniquement les boxes tags et all games */
    .cat-sidebar-box:has(.cat-sidebar-collapse) { display: none; }
    /* Box "Monetize" tout en bas de page sur mobile, après la pagination */
    .category-page-layout {
        grid-template-areas:
            "hero"
            "partner"
            "ads"
            "sidebar"
            "main"
            "monetize";
    }
    .category-page-layout .cat-sidebar { display: contents; }
    .cat-sidebar-monetize { grid-area: monetize; }
    /* Cat-hero : tout centré sur mobile */
    .cat-hero { width: 100%; align-items: center; }
    .cat-hero-top { flex-direction: column; align-items: center; gap: 12px; }
    .cat-hero-logo { max-width: 72px; align-self: auto; }
    .cat-hero-text { text-align: center; }
    .cat-hero-desc { text-align: center; }
    .cat-hero-text h1 { font-size: 28px; }
    .cat-hero-text h2 { font-size: 14px; }
    .cat-hero-desc { font-size: 14px; }
    .cat-partner-link { gap: 8px; min-height: 38px; padding: 5px 8px; }
    .cat-partner-logo { display: none; }
    .cat-partner-link > span:not(.cat-partner-cta) { flex: 1 1 auto; font-size: 13px; white-space: normal; text-align: left; }
    .cat-partner-cta { padding: 5px 7px; font-size: 11px !important; }
    .tip4serv-promo-link { gap: 10px; min-height: 68px; padding: 8px 10px; }
    .tip4serv-promo-image { width: 72px; height: 48px; }
    .tip4serv-promo-copy strong { font-size: 14px; }
    .tip4serv-promo-copy span { font-size: 11px; }
    .tip4serv-promo-cta { padding: 6px 7px; font-size: 0; }
    .tip4serv-promo-cta i { font-size: 14px; }
    .cat-filter-bar { display: none !important; }
    .cat-filter-mobile-btn { display: flex; }
    .cat-filterbar-row {
        flex-direction: column;
        height: auto;
        gap: 10px;
    }
    .cat-filter-search {
        width: 100%;
        height: 40px;
    }
    .cat-filter-search input[type="text"] {
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
    }
    /* Cards mobile : footer sur une ligne, tag jeu + favoris + vues masqués */
    .server-card-body { align-items: stretch; }
    a:has(.server-card-tag--primary) { display: none; }
    .server-card-stat:has(.fa-heart),
    .server-card-stat:has(.fa-eye) { display: none; }
    .server-card-footer {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        align-self: stretch !important;
        min-width: 0;
        box-sizing: border-box;
    }
    .server-card-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .server-card-tags::-webkit-scrollbar { display: none; }
    /* Fondu au bout, comme sur les onglets de la page serveur */
    .server-card-tags-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, var(--bg-secondary));
        pointer-events: none;
    }
    .server-card-tags-wrap--at-end::after { display: none; }
    .server-card-stats {
        flex-shrink: 0;
        justify-content: flex-end;
    }

    .server-card-ip-row:not(:has(.server-card-info-badge)) .form-control { margin-right: 0 !important; }
    .server-card-ip-group a.input-group-addon { display: none !important; }
    .server-card-mobile-copy {
        display: inline-flex !important;
        align-items: center;
        gap: 5px;
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 11px;
        padding: 0 10px;
        height: 28px;
        border-radius: 6px 0 0 6px !important;
        cursor: pointer;
    }
    .server-card-mobile-copy--online {
        border: 1px solid rgba(34, 197, 94, 0.35);
        border-right: 1px solid rgba(34, 197, 94, 0.5);
        background: rgba(34, 197, 94, 0.12) !important;
        color: #4ade80 !important;
    }
    .server-card-mobile-copy--offline {
        border: 1px solid rgba(239, 68, 68, 0.35);
        border-right: 1px solid rgba(239, 68, 68, 0.5);
        background: rgba(239, 68, 68, 0.12) !important;
        color: #f87171 !important;
    }
    .server-card-ip-row .input-group-addon.copy-btn.copy-btn--online {
        background: rgba(34, 197, 94, 0.12) !important;
        border-color: rgba(34, 197, 94, 0.35) !important;
        color: #4ade80 !important;
    }

    /* Page serveur : h1 tronqué à 3 lignes */
    .server-header-name {
        max-height: calc(3 * 1.25em);
        overflow: hidden;
    }
}

/* Tablette : Tags + Filtres buttons, filter bar et sidebar cachées (768–991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .cat-filter-bar { display: none !important; }
    .cat-sidebar-box--games { display: none; }
    .cat-filter-mobile-btn { display: flex; }
    .cat-filterbar-row {
        flex-direction: column;
        height: auto;
        gap: 10px;
    }
    .cat-filter-search {
        width: 100%;
        height: 40px;
    }
    .cat-filter-search input[type="text"] {
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
    }
    .cat-mobile-tagcount-row { margin-bottom: 10px; }
    .ts-count-moved { width: 100%; }
    .ts-count-moved .alert {
        margin: 0;
        padding: 0 14px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 14px;
        border-radius: 10px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        line-height: 1;
    }
    .ts-count-moved .alert .close { display: none; }
    /* Hero titre tablette */
    .cat-hero-text h1 { font-size: 32px; }
    .cat-hero-text h2 { font-size: 15px; }
    .cat-hero-desc { font-size: 14px; }
    /* Cards : tags sur une ligne, stats en dessous */
    .server-card-tags-wrap { flex: none; width: 100%; }
    .server-card-tags { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 4px; }
    .server-card-tags::-webkit-scrollbar { display: none; }
    .server-card-tags-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 4px;
        width: 20px;
        background: linear-gradient(to right, transparent, var(--bg-secondary));
        pointer-events: none;
    }
    .server-card-tags-wrap--at-end::after { display: none; }
    .server-card-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
    .server-card-stats { width: 100%; justify-content: flex-end; }
    /* Footer : 2 colonnes */
    .ts-footer-col { flex: 1 1 calc(50% - 16px); }
}

/* Mobile paysage (ex: iPhone 812×375) */
@media (max-width: 991px) and (orientation: landscape) {
    .cat-hero-text h1 { font-size: 20px !important; }
    .cat-hero-text h2 { font-size: 13px !important; }
    .cat-hero-desc { font-size: 13px !important; }
    .cat-hero { padding: 6px 0 !important; }
    .cat-hero-logo { max-width: 52px !important; }
}

/* Desktop étroit (992–1279px) : compresser filter bar + reset icon-only */
@media (min-width: 992px) and (max-width: 1279px) {
    .cat-filter-btn { padding: 8px 6px; font-size: 13px; gap: 4px; }
    .cat-filter-bar .cat-filter-reset { font-size: 0; padding: 4px 8px; gap: 0; }
    .cat-filter-bar .cat-filter-reset .fa { font-size: 12px; }
}

/* Desktop intermédiaire (1280–1399px) : compresser boutons filtre, reset garde son texte */
@media (min-width: 1280px) and (max-width: 1399px) {
    .cat-filter-btn { padding: 8px 6px; font-size: 13px; gap: 4px; }
}

/* Desktop (≥1280px) : charts stats plus hauts */
@media (min-width: 1280px) {
    #canvas_players_number,
    #canvas_votes_number { height: 400px !important; }
}

/* =============================================
   CHART STATS (chart_default.php)
   ============================================= */
.charts-container { gap: 6px; }
#canvas_players_number,
#canvas_votes_number { height: 300px; }
/* Bouton actif : orange au lieu du bleu Bootstrap */
.charts-container .btn-primary {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.charts-container .btn-primary:hover { background-color: #c96e0e !important; border-color: #c96e0e !important; }
.charts-container .btn:focus,
.charts-container .btn:active,
.charts-container .btn:focus-visible { outline: none !important; box-shadow: none !important; }
.charts-container .btn-outline-secondary {
    border-color: var(--text-muted) !important;
    color: var(--text-primary) !important;
    background: var(--bg-secondary) !important;
}
.charts-container .btn-outline-secondary:hover { background: color-mix(in srgb, var(--bg-secondary) 60%, var(--accent)) !important; border-color: var(--accent) !important; }

/* =============================================
   DATERANGEPICKER — THÈME SOMBRE
   ============================================= */
.daterangepicker,
.daterangepicker.dropdown-menu {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}
.daterangepicker:before { border-bottom-color: var(--border) !important; }
.daterangepicker:after { border-bottom-color: var(--bg-secondary) !important; }
.daterangepicker .calendar-table {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
}
.daterangepicker td, .daterangepicker th { color: var(--text-primary) !important; }
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
    background-color: var(--bg-primary) !important;
}
.daterangepicker td.in-range {
    background-color: rgba(232, 134, 26, 0.15) !important;
    color: var(--text-primary) !important;
}
.daterangepicker td.active, .daterangepicker td.active:hover {
    background-color: var(--accent) !important;
    color: #fff !important;
}
.daterangepicker td.off { color: var(--text-muted) !important; background: transparent !important; }
/* Ranges list */
.ranges li {
    background-color: var(--bg-primary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
}
.ranges li:hover {
    background-color: rgba(232, 134, 26, 0.15) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}
.ranges li.active {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
/* Bouton Apply */
.daterangepicker .btn-success {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
/* Span date display */
#reportrange {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}
#reportrange span { color: var(--text-primary); }

/* =============================================
   SUMMERNOTE DARK THEME
   ============================================= */
/* Lettre "A" toujours blanche, background transparent, barre via JS box-shadow */
.note-toolbar .note-current-color-button .note-icon-font,
.note-toolbar .note-current-color-button .note-recent-color {
    color: #fff !important;
    background-color: transparent !important;
    padding-bottom: 4px !important;
}

/* Supprime le caret Bootstrap 5 sur les boutons Summernote (doublon avec la flèche native) */
.note-toolbar .dropdown-toggle::after,
.note-toolbar .dropdown-toggle::before {
    display: none !important;
}
.note-editor.note-frame {
    border: 1px solid #555570 !important;
    border-radius: 8px !important;
    overflow: hidden;
}
.note-editor .note-toolbar {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid #555570 !important;
    padding: 6px 8px !important;
}
.note-editor .note-btn:not(.note-color-btn) {
    background-color: #3a3d45 !important;
    border-color: #555570 !important;
    color: var(--text-primary) !important;
}
.note-editor .note-btn:not(.note-color-btn):hover,
.note-editor .note-btn:not(.note-color-btn):focus {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.note-editor .note-btn-group .note-btn.active:not(.note-color-btn) {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.note-editor .note-editable {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    min-height: 200px;
}
.note-editor .note-statusbar {
    background-color: var(--bg-secondary) !important;
    border-top: 1px solid #555570 !important;
}
.note-editor .note-statusbar .note-resizebar {
    cursor: ns-resize;
}
.note-editor .note-statusbar .note-resizebar .note-icon-bar {
    border-top-color: var(--text-muted) !important;
}
.note-editor .note-placeholder {
    color: var(--text-muted) !important;
}
/* Dropdowns summernote-lite */
.note-editor .note-dropdown-menu {
    background-color: var(--bg-secondary) !important;
    border: 1px solid #555570 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
}
.note-editor .note-dropdown-item {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}
.note-editor .note-dropdown-item:hover,
.note-editor .note-dropdown-item:focus,
.note-editor .note-dropdown-item.active {
    background-color: var(--accent) !important;
    color: #fff !important;
}
/* Style selector (h1, h2, code...) */
.note-editor .note-dropdown-menu .note-dropdown-item[data-value] {
    background-color: transparent !important;
    color: var(--text-primary) !important;
}
.note-editor .note-dropdown-menu .note-dropdown-item[data-value]:hover {
    background-color: var(--accent) !important;
    color: #fff !important;
}
/* Inline btn groups (alignment icons) — exclut les cellules couleur */
.note-editor .note-para .note-dropdown-menu {
    padding: 6px !important;
    width: fit-content !important;
    min-width: unset !important;
    left: 0 !important;
    right: auto !important;
}
.note-editor .note-toolbar .note-para .note-dropdown-menu > div + div {
    margin-left: 0 !important;
}
.note-editor .note-para .note-dropdown-menu .para-row {
    display: flex !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
}
.note-editor .note-para .note-dropdown-menu .para-row:last-child {
    margin-bottom: 0 !important;
}
.note-editor .note-dropdown-menu .note-btn:not(.note-color-btn) {
    background-color: #3a3d45 !important;
    border-color: #555570 !important;
    color: var(--text-primary) !important;
}
.note-editor .note-dropdown-menu .note-btn:not(.note-color-btn):hover {
    background-color: var(--accent) !important;
    color: #fff !important;
}
.note-editor .note-current-color-button .note-recent-color {
    opacity: 0.9;
}
/* Color picker panel — layout côte à côte + dark theme */
.note-editor .note-color-all .note-dropdown-menu,
.note-editor .note-color .note-dropdown-menu {
    background-color: var(--bg-secondary) !important;
    padding: 8px !important;
    min-width: unset !important;
    width: fit-content !important;
    white-space: nowrap !important;
}
.note-editor .note-color .note-dropdown-menu .note-palette {
    display: inline-block !important;
    width: 160px !important;
    margin: 0 4px !important;
    vertical-align: top !important;
    white-space: normal !important;
}
.note-editor .note-palette-title {
    color: var(--text-primary) !important;
    background-color: transparent !important;
    border-bottom: 1px solid #555570 !important;
    margin: 2px 0 4px !important;
    padding-bottom: 4px !important;
    font-size: 12px !important;
    text-align: center !important;
}
.note-editor .note-color-reset,
.note-editor .note-color-select {
    background-color: #3a3d45 !important;
    color: var(--text-primary) !important;
    border: 1px solid #555570 !important;
    border-radius: 4px !important;
    width: 100% !important;
    margin: 3px 0 !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    cursor: pointer !important;
}
.note-editor .note-color-reset:hover,
.note-editor .note-color-select:hover {
    background-color: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}
.note-editor .note-color-palette div .note-color-btn {
    border: 1px solid rgba(255,255,255,0.1) !important;
}
.note-editor .note-color-palette div .note-color-btn:hover {
    border: 1px solid #fff !important;
}
/* Ligne de séparation */
.note-editor .note-dropdown-menu hr {
    border-color: #555570 !important;
}
/* Style dropdown : item "Code" a un <code> avec fond clair par défaut */
.note-editor .note-dropdown-item code {
    background-color: #3a3d45 !important;
    color: var(--text-primary) !important;
    border: 1px solid #555570 !important;
    padding: 1px 4px;
    border-radius: 3px;
}
.note-editor .note-dropdown-item:hover code {
    background-color: transparent !important;
    border-color: transparent !important;
    color: #fff !important;
}
/* Table picker — dimension display */
.note-editor .note-dimension-display {
    color: #fff !important;
}
/* Modal image / lien — dark theme complet */
.note-modal,
.note-modal * {
    box-sizing: border-box;
}
.note-modal .note-modal-content {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid #555570 !important;
    border-radius: 8px !important;
    overflow: hidden;
}
/* Header : on cible toutes les variantes possibles */
.note-modal .note-modal-content > div:first-child,
.note-modal .note-modal-header,
.note-modal-header {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid #555570 !important;
    color: var(--text-primary) !important;
}
.note-modal .note-modal-title,
.note-modal h4 {
    color: var(--text-primary) !important;
}
/* Footer */
.note-modal .note-modal-content > div:last-child,
.note-modal .note-modal-footer,
.note-modal-footer {
    background-color: var(--bg-primary) !important;
    border-top: 1px solid #555570 !important;
}
.note-modal .note-btn {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.note-modal .close,
.note-modal button.close {
    color: var(--text-primary) !important;
    opacity: 0.8;
    background: transparent !important;
    border: none !important;
    text-shadow: none !important;
}
.note-modal label {
    color: var(--text-primary) !important;
}
.note-modal input[type="text"],
.note-modal input[type="file"] {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid #555570 !important;
    border-radius: 6px !important;
}
/* Supprime le focus outline sur le file input */
.note-image-input,
.note-form-control.note-input,
input.form-control-file,
.note-modal input[type="file"] {
    outline: none !important;
    box-shadow: none !important;
}

/* Bouton natif "Parcourir..." du file input */
.note-modal input[type="file"]::file-selector-button,
.note-modal input[type="file"]::-webkit-file-upload-button {
    background-color: #3a3d45 !important;
    color: var(--text-primary) !important;
    border: 1px solid #555570 !important;
    border-radius: 4px !important;
    padding: 4px 12px !important;
    cursor: pointer;
    transition: background 0.2s;
}
.note-modal input[type="file"]::file-selector-button:hover,
.note-modal input[type="file"]::-webkit-file-upload-button:hover {
    background-color: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}
/* Backdrop cliquable pour fermer */
.note-modal {
    cursor: pointer;
}
.note-modal .note-modal-content {
    cursor: default;
}
/* Fix layout modal : footer ne doit pas être position absolute */
.note-modal .note-modal-content {
    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh;
}
.note-modal .note-modal-body {
    flex: 1 !important;
    overflow-y: auto;
}
.note-modal .note-modal-footer {
    position: relative !important;
    flex-shrink: 0 !important;
    height: 55px !important;
}

/* ── Dark theme tables ── */
.table {
    color: var(--text-primary) !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border) !important;
}
.table th,
.table td {
    color: var(--text-primary) !important;
    background-color: transparent !important;
    border-color: var(--border) !important;
}
.table thead th {
    background-color: var(--bg-primary) !important;
    border-bottom: 2px solid var(--border) !important;
}
.table tbody tr:hover td {
    background-color: var(--card-hover) !important;
}
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

/* =============================================
   TABLETTE — 767px × 1024px
   ============================================= */
@media (max-width: 900px) and (min-width: 541px) {
    /* Compteurs hero : label plus petit pour éviter le wrap */
    .ts-hero-counter-label {
        font-size: 13px;
        letter-spacing: 0.5px;
    }
    .ts-hero-counter-value {
        font-size: 28px;
    }
    .ts-hero-counter {
        padding: 16px 16px;
    }
    /* Tagline */
    .ts-hero-tagline {
        font-size: 32px;
    }
    /* Titres des game cards : autoriser 2 lignes */
    .ts-game-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    /* Stats servers/players */
    .ts-game-stat {
        font-size: 11px;
        padding: 6px 8px;
        gap: 5px;
    }
    .ts-game-stat i {
        font-size: 11px;
    }
    .ts-games-grid {
        gap: 10px;
    }
}

/* Agrandir le container Bootstrap (limité à 540px/720px par défaut selon le
   breakpoint) jusqu'à la première résolution desktop, pour éviter que le
   contenu (et notamment la sidebar .col-md-3) reste étriqué entre 901 et
   991px alors qu'il y a de la place. */
@media (max-width: 991px) and (min-width: 541px) {
    .container {
        max-width: calc(100% - 16px) !important;
    }
    /* Barre de recherche même largeur que les cards */
    .ts-hero {
        padding-left: 0;
        padding-right: 0;
    }
    /* Navbar même largeur de contenu que ts-hero-content : calc(100% - 40px) */
    #main-navbar .container {
        max-width: calc(100% - 16px) !important;
        padding-left: 60px !important;
        padding-right: 60px !important;
    }
    /* Burger poussé au bord droit */
    .navbar-toggler {
        margin-left: auto;
    }
}

/* =============================================
   FOOTER — centrage sur mobile
   ============================================= */
@media (max-width: 767px) {
    .ts-footer-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }
    .ts-footer-col {
        width: 100%;
        flex: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .ts-footer-col:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .ts-footer-links {
        align-items: center;
    }
    .sticky-footer h4.title {
        text-align: center;
        font-size: 16px;
    }
    .ts-footer-copy {
        text-align: center;
    }
}

/* =============================================
   MOBILE SPÉCIFIQUE — grands téléphones (≤ 430px)
   iPhone Plus/Pro Max, Samsung Galaxy S
   ============================================= */
@media (max-width: 430px) {
    /* Navbar */
    .ts-brand span { font-size: 20px; }
    .ts-brand img  { width: 40px; height: 40px; }
    #main-navbar { padding-left: 0 !important; padding-right: 0 !important; }
    #main-navbar .container { padding-left: 0 !important; padding-right: 0 !important; max-width: 100% !important; width: 100% !important; }
    #main-navbar .ts-brand-link { margin-left: 12px !important; margin-right: 0 !important; }
    #main-navbar .navbar-toggler { margin-right: 12px !important; margin-left: 0 !important; }
    #main-navbar .nav-link { font-size: 14px; padding-left: 10px !important; padding-right: 10px !important; }

    /* Hero */
    .ts-hero { padding: 30px 0 2px; }
    .ts-hero-tagline { font-size: 28px; margin-bottom: 20px; }
    .ts-hero-desc { font-size: 16px; }
    .ts-hero-counter-value { font-size: 28px; }
    .ts-hero-counter-label { font-size: 16px; }
    .ts-hero-counter { padding: 16px 20px; }

    /* Server header */
    #server-header-panel .panel-body { padding: 12px 16px 8px; gap: 0; }
    .server-header-meta:not(:has(> *)) { display: none; }
    .server-header-meta:has(> *) {
        margin-top: 10px;
        padding: 8px 0;
        border-top: 1px solid var(--border);
    }
    .server-header-name { font-size: 20px !important; }
    .server-header-icon,
    .server-header-icon img { width: 90px; height: 90px; }

    /* Onglets — tailles plus compactes (scroll + fondu gérés par la règle ≤991px) */
    #details_tab .nav-link { font-size: 14px !important; padding: 7px 6px !important; }
    #details_tab .nav-link i { font-size: 14px !important; }

    /* Stats bar — 2 colonnes */
    .server-stats-bar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding-top: 10px; }
    .stat-chip { flex: 1 1 calc(50% - 4px); padding: 8px 10px; min-height: 70px; align-items: center; text-align: center; }
    .stat-chip-top { font-size: 17px; gap: 4px; justify-content: center; }
    .stat-chip .connected_player,
    .stat-chip .u_votes,
    .stat-chip .u_favorites { font-size: 17px; }
    .stat-chip-top i { font-size: 13px; }
    .stat-chip-label { font-size: 10px; letter-spacing: 0.5px; margin-top: 1px; }

    /* Info rows */
    .server-info-row { padding: 8px 2px; gap: 8px; }
    .info-icon { width: 22px; height: 22px; font-size: 13px; }
    .info-label { min-width: 75px; font-size: 13px; }
    .info-value { font-size: 13px; }
    .info-value .server-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; display: inline-block; }

    /* Modals */
    #ts-login-box,
    #ts-vote-box { padding: 20px 16px; }

    /* Container */
    .container { padding-left: 10px; padding-right: 10px; }

    /* Details tab */
    #details_tab .nav-link { font-size: 14px; padding: 6px 8px !important; }

    /* Category filter bar */
    .cat-filter-btn { font-size: 11px; padding: 5px 7px; }
    .cat-filter-search input[type="text"] { width: 100% !important; }

    /* Footer */
    .ts-footer-row { gap: 20px; }
    .ts-footer-col { flex: 1 1 130px; }
}

/* =============================================
   MOBILE SPÉCIFIQUE — iPhone standard (≤ 390px)
   iPhone 14/15 Pro, Pixel 7/8
   ============================================= */
@media (max-width: 390px) {
    /* Navbar */
    .ts-brand span { font-size: 18px; }
    .ts-brand img  { width: 36px; height: 36px; }

    /* Hero */
    .ts-hero-tagline { font-size: 24px; }
    .ts-hero-counter { width: 75%; }
    .ts-hero-counter-value { font-size: 24px; }
    .ts-hero-counter-label { font-size: 14px; }

    /* Server header — tailles plus compactes (structure gérée par la règle ≤991px) */
    .server-header-icon,
    .server-header-icon img { width: 64px; height: 64px; }
    .server-header-name { font-size: 15px !important; }
    /* Chart stats mobile */
    .charts-container { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .charts-container .btn { width: auto !important; flex: 1; font-size: 12px; padding: 5px 6px; }
    .charts-container #reportrange { width: 100% !important; text-align: left !important; padding: 4px 8px; font-size: 12px; }
    #canvas_players_number,
    #canvas_votes_number { height: 220px !important; }
    .server-header-desc { font-size: 13px; }
    .server-fav-btn { width: 28px; height: 28px; }
    .server-fav-btn .glyphicon-heart-empty,
    .server-fav-btn .glyphicon-heart { font-size: 18px; }

    /* Stats bar — 2 colonnes serrées */
    .stat-chip { padding: 12px 10px; }
    .stat-chip-top,
    .stat-chip .connected_player,
    .stat-chip .u_votes,
    .stat-chip .u_favorites { font-size: 18px; }
    .stat-chip-label { font-size: 11px; }

    /* Info label plus court */
    .info-label { min-width: 90px; }

    /* Onglets — encore plus compacts */
    #details_tab .nav-link { font-size: 14px !important; padding: 5px 7px !important; }

    /* Cards */
    .server-card-icon { width: 54px; height: 54px; }
    .server-card-title { font-size: 13px; }

    /* Category hero */
    .cat-hero-text h1 { font-size: 28px; }
    .cat-hero-logo { max-width: 60px; }
}

/* =============================================
   MOBILE SPÉCIFIQUE — petit iPhone (≤ 375px)
   iPhone SE, iPhone 12/13/14 standard
   ============================================= */
@media (max-width: 375px) {
    /* Navbar */
    .ts-brand span { font-size: 16px; }
    .ts-brand img  { width: 32px; height: 32px; }
    #main-navbar { padding: 8px 0; }
    body { padding-top: 64px; }

    /* Hero encore plus compact */
    .ts-hero { padding: 20px 0 2px; }
    .ts-hero-tagline { font-size: 20px; margin-bottom: 14px; }
    .ts-hero-desc { font-size: 14px; }
    .ts-hero-counter { padding: 10px 14px; width: 75%; }
    .ts-hero-counter-value { font-size: 20px; }
    .ts-hero-counter-label { font-size: 12px; }
    .ts-hero-search input { font-size: 14px; padding: 12px 14px 12px 40px; }

    /* Server header */
    .server-header-icon,
    .server-header-icon img { width: 60px; height: 60px; }
    .server-header-name { font-size: 15px !important; }
    #server-header-panel .panel-body { padding: 10px 12px; }

    /* Stats */
    .stat-chip { padding: 10px 8px; }
    .stat-chip-top,
    .stat-chip .connected_player,
    .stat-chip .u_votes,
    .stat-chip .u_favorites { font-size: 16px; }

    /* Info rows */
    .info-label { min-width: 80px; font-size: 13px; }
    .info-value { font-size: 13px; }
    .info-icon { width: 24px; height: 24px; font-size: 14px; }

    /* Cards */
    .server-card-icon { width: 48px; height: 48px; }
    .server-card-title { font-size: 12px; }
    .server-card-body { padding: 10px 12px; }

    /* Modals */
    #ts-login-box,
    #ts-vote-box { padding: 16px 12px; border-radius: 10px; }

    /* Category */
    .cat-hero-text h1 { font-size: 24px; }
    .cat-hero-text h2 { font-size: 14px; }
    .cat-hero-logo { max-width: 70px; }
    .cat-filter-btn { font-size: 10px; padding: 4px 6px; gap: 4px; }

    /* Footer */
    .ts-footer-col { flex: 1 1 100%; }
    .ts-footer-copy a { font-size: 14px; }
}

/* --- Avatar/cover crop overlay (pages/designs.php) --- */
#ts-crop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
#ts-crop-overlay.open { display: flex; }
#ts-crop-box {
    background: #1e1e2d;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
}
#ts-crop-stage {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 100%;
    background: #000;
    border-radius: 6px;
    touch-action: none;
    cursor: grab;
}
#ts-crop-stage.dragging { cursor: grabbing; }
#ts-crop-stage img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}
#ts-crop-mask {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.65);
    border: 2px solid rgba(255,255,255,.9);
    pointer-events: none;
}
#ts-crop-mask.round { border-radius: 50%; }
.ts-crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.ts-crop-zoom-row input[type=range] { flex: 1; }
.ts-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* --- Profile header (pages/profile.php) --- */
.header_img {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    aspect-ratio: 2.5 / 1;
    width: 100%;
    align-items: flex-end;
    display: flex;
    position: relative;
    margin-top: 10px;
    border-radius: 8px 8px 0 0;
}
#cover.header_img + .panel.panel-default {
    border-radius: 0 0 10px 10px !important;
}
.logo_round {
    height: 13rem;
    min-width: 13rem;
    width: 13rem;
    display: block;
    border: 3px solid #fff;
    border-radius: 50%;
    background-clip: padding-box;
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}
.logo_placement {
    transform: translateY(30%);
    width: auto;
    margin: 0 auto;
    position: relative;
}
.table-fixed-full h1 {
    margin-bottom: 0;
}
@media (max-width: 767px) {
    .logo_round {
        height: 8rem;
        min-width: 8rem;
        width: 8rem;
    }
}
.ts-vote-all-short { display: none; }
@media (max-width: 539px) {
    #ts-vote-all-wrap .ts-vote-btn {
        padding: 0 4px !important;
        font-size: 11px;
        line-height: 1.2;
    }
    .ts-vote-all-full { display: none; }
    .ts-vote-all-short { display: inline; }
    #ts-vote-found-row .alert-info {
        font-size: 13px;
    }
}
@media (min-width: 540px) and (max-width: 767px) {
    #ts-vote-all-wrap .ts-vote-btn {
        font-size: 13px;
    }
}
