/* GameCMS native output compatibility.
 * The core and extra modules can append Bootstrap helpers after TPL rendering.
 * Keep their neutral surfaces in the selected theme. Do not change visibility,
 * dimensions of progress fills, user content images, or the engine callbacks.
 */

/* Bootstrap marks these helpers important, so the theme has to match it. */
body.n-next .bg-light {
    background-color: var(--n-surface-2) !important;
}
body.n-next .bg-white {
    background-color: var(--n-surface) !important;
}
body.n-next a.bg-light:hover,
body.n-next a.bg-light:focus,
body.n-next button.bg-light:hover,
body.n-next button.bg-light:focus {
    background-color: var(--n-surface-3) !important;
}
body.n-next .border,
body.n-next .border-top,
body.n-next .border-right,
body.n-next .border-bottom,
body.n-next .border-left,
body.n-next .border-light,
body.n-next .border-white {
    border-color: var(--n-line) !important;
}
body.n-next .border-primary,
body.n-next .border-info {
    border-color: var(--n-link) !important;
}
body.n-next .border-success {
    border-color: var(--n-success) !important;
}
body.n-next .border-warning {
    border-color: var(--n-warning) !important;
}
body.n-next .border-danger {
    border-color: var(--n-danger) !important;
}
body.n-next .border-secondary,
body.n-next .border-dark {
    border-color: var(--n-muted) !important;
}
body.n-next .text-dark,
body.n-next .text-body,
body.n-next .text-black {
    color: var(--n-text) !important;
}
body.n-next .text-black-50,
body.n-next .text-white-50 {
    color: var(--n-muted) !important;
}
body.n-next .bg-light.text-white,
body.n-next .bg-light.text-light,
body.n-next .bg-white.text-white,
body.n-next .bg-white.text-light,
body.n-next .bg-light > .text-white,
body.n-next .bg-light > .text-light,
body.n-next .bg-white > .text-white,
body.n-next .bg-white > .text-light {
    color: var(--n-text) !important;
}

/* Neutral widgets emitted by native modules, lists and category headings. */
body.n-next .card,
body.n-next .list-group-item {
    color: var(--n-text);
    background-color: var(--n-surface);
    border-color: var(--n-line);
}
body.n-next .card {
    border-radius: var(--n-radius);
}
body.n-next .card-header:first-child {
    border-radius: calc(var(--n-radius) - 1px) calc(var(--n-radius) - 1px) 0 0;
}
body.n-next .card-footer:last-child {
    border-radius: 0 0 calc(var(--n-radius) - 1px) calc(var(--n-radius) - 1px);
}

/* Extra site statistics keep their native output and values. These rules only
 * cover its supplied container and ordinary Bootstrap children. */
body.n-next #site_stats {
    min-width: 0;
    color: var(--n-text);
    font-size: 14px;
    line-height: 1.65;
}
body.n-next #site_stats .block,
body.n-next #site_stats .card {
    color: var(--n-text);
    background-color: var(--n-surface);
    border-color: var(--n-line);
    border-radius: var(--n-radius);
}
body.n-next #site_stats .row > [class*="col-"] {
    min-width: 0;
    overflow-wrap: anywhere;
}
body.n-next #site_stats small {
    font-size: 12px;
    line-height: 1.6;
}

body.n-next .card-header,
body.n-next .card-footer,
body.n-next .list-group-item-light,
body.n-next .alert-light,
body.n-next .badge-light {
    color: var(--n-text);
    background-color: var(--n-surface-2);
    border-color: var(--n-line);
}
body.n-next .list-group-item-action:hover,
body.n-next .list-group-item-action:focus,
body.n-next a.badge-light:hover,
body.n-next a.badge-light:focus {
    color: var(--n-text);
    background-color: var(--n-surface-3);
}
body.n-next .list-group-item.active {
    color: var(--n-accent-ink);
    background-color: var(--n-accent);
    border-color: var(--n-accent);
}
body.n-next .list-group-item-success {
    color: var(--n-success);
    background-color: var(--n-success-soft);
}
body.n-next .list-group-item-warning {
    color: var(--n-warning);
    background-color: var(--n-warning-soft);
}
body.n-next .list-group-item-danger {
    color: var(--n-danger);
    background-color: var(--n-danger-soft);
}
body.n-next .btn.btn-light,
body.n-next .btn.btn-outline-light {
    color: var(--n-text);
    background-color: var(--n-surface-2);
    border-color: var(--n-line);
}
body.n-next .btn.btn-light:hover,
body.n-next .btn.btn-outline-light:hover,
body.n-next .btn.btn-light:focus,
body.n-next .btn.btn-outline-light:focus {
    color: var(--n-text);
    background-color: var(--n-surface-3);
    border-color: var(--n-muted);
}
body.n-next table.table .thead-light th,
body.n-next table.table .thead-light td,
body.n-next table.table .table-light,
body.n-next table.table .table-light > th,
body.n-next table.table .table-light > td,
body.n-next table.table.table-light > tbody > tr > th,
body.n-next table.table.table-light > tbody > tr > td {
    color: var(--n-text);
    background-color: var(--n-surface-2);
    border-color: var(--n-line);
}

/* Both a background and a border are used for dividers in GameCMS versions. */
body.n-next hr {
    color: var(--n-line) !important;
    background-color: var(--n-line) !important;
    border-color: var(--n-line) !important;
}
body.n-next .dropdown-divider,
body.n-next #last_activity > span,
body.n-next #last_activity > div,
body.n-next #forum .row .col-lg-8,
body.n-next #forum .row .col-lg-4,
body.n-next #forum_topics .row .col-lg-8,
body.n-next #forum_topics .row .col-lg-4,
body.n-next .with_code table tr td {
    border-color: var(--n-line) !important;
}
body.n-next #forum > h2,
body.n-next #forum .col-lg-12 > h2,
body.n-next #forum_topics > h2,
body.n-next #forum_topics .col-lg-12 > h2 {
    color: var(--n-text);
    background-color: var(--n-surface-2) !important;
    border-color: var(--n-line) !important;
}

/* The core may mark either the list item or its link active. The original
 * active-link negative margins must not paint a strip outside the sidebar. */
body.n-next .vertical-navigation ul li,
body.n-next .vertical-navigation ul li.active,
body.n-next .vertical-navigation ul li:hover {
    background-color: transparent;
    border-color: transparent;
}
body.n-next .vertical-navigation ul li a.active,
body.n-next .vertical-navigation ul li.active > a,
body.n-next .vertical-navigation ul li a[aria-current="page"] {
    margin-left: 0;
    margin-right: 0;
    color: var(--n-link);
    background-color: var(--n-accent-soft);
    border-color: transparent;
}
body.n-next .vertical-navigation ul li a.active::before {
    background-color: transparent;
}

/* Preserve the supplied percentage width and native numeric overlay. Soft
 * status fills keep the overlay readable on both the filled and empty track. */
body.n-next .players,
body.n-next .servers-online-line .progress-val {
    color: var(--n-text);
}
body.n-next .servers-online-line,
body.n-next .players .progress {
    background-color: var(--n-surface-3);
    border-color: var(--n-line);
}
body.n-next .servers-online-line .progress-bar,
body.n-next .players .progress-bar {
    margin: 0;
    background-color: var(--n-accent-soft) !important;
    border-color: transparent;
    color: var(--n-text);
}
body.n-next .servers-online-line .progress-bar.bg-success,
body.n-next .players .progress-bar.bg-success {
    background-color: var(--n-success-soft) !important;
}
body.n-next .servers-online-line .progress-bar.bg-warning,
body.n-next .players .progress-bar.bg-warning {
    background-color: var(--n-warning-soft) !important;
}
body.n-next .servers-online-line .progress-bar.bg-danger,
body.n-next .players .progress-bar.bg-danger {
    background-color: var(--n-danger-soft) !important;
}
body.n-next .servers-online-line .progress-val {
    z-index: 1;
}
