/* Chochrun legacy shell corrections layered after the SourceBans++ v2 theme. */
body.chochrun-legacy {
    color-scheme: dark;
    --bg-page: var(--zinc-950);
    --bg-surface: var(--zinc-900);
    --bg-muted: var(--zinc-800);
    --border: var(--zinc-700);
    --text: var(--zinc-100);
    --text-muted: var(--zinc-300);
    --text-faint: var(--zinc-400);
    --accent-soft: rgb(67 20 7 / 0.4);
    --success-bg: rgb(6 78 59 / 0.4);
    --warning-bg: rgb(120 53 15 / 0.4);
    --danger-bg: rgb(127 29 29 / 0.4);
    --info-bg: rgb(30 58 138 / 0.4);
    background: #1d1d1d;
    color: var(--text);
}

body.chochrun-legacy #content h1,
body.chochrun-legacy #content h2,
body.chochrun-legacy #content h3,
body.chochrun-legacy #content h4 {
    color: var(--text);
}

body.chochrun-legacy #content a:not(.btn) {
    color: inherit;
}

body.chochrun-legacy [data-testid="dashboard-intro"] .card__body {
    color: var(--text);
    line-height: 1.65;
}

body.chochrun-legacy [data-testid="dashboard-intro"] img {
    display: block;
    width: min(100%, 756px);
    height: auto;
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Main navigation: keep the compact legacy geometry, but make state and
   keyboard focus obvious against the dark shell. */
body.chochrun-legacy #tabsWrapper {
    background: linear-gradient(180deg, #3d3934 0%, #302d29 100%);
    border-top: 1px solid #504a43;
    border-bottom: 1px solid #171614;
    box-shadow: 0 5px 16px rgb(0 0 0 / 0.24), inset 0 1px rgb(255 255 255 / 0.025);
}

body.chochrun-legacy #tabs ul li a {
    position: relative;
    color: #eceae7;
    letter-spacing: 0.035em;
    text-shadow: 0 1px 1px rgb(0 0 0 / 0.7);
    transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

body.chochrun-legacy #tabs ul li + li a {
    border-left: 1px solid rgb(255 255 255 / 0.055);
}

body.chochrun-legacy #tabs ul li a:hover {
    color: #ffffff;
    background: #292b29;
    box-shadow: inset 0 -3px #3f9367;
}

body.chochrun-legacy #tabs ul li.active a,
body.chochrun-legacy #tabs ul li.active a:hover {
    color: #79efb4;
    background: linear-gradient(180deg, #242a27 0%, #202320 100%);
    box-shadow: inset 0 -3px #55d596, inset 0 1px rgb(255 255 255 / 0.035);
}

body.chochrun-legacy #tabs ul li a:focus-visible {
    z-index: 1;
    color: #ffffff;
    outline: 2px solid #79efb4;
    outline-offset: -3px;
    background: #252b28;
}

body.chochrun-legacy .legacy-login,
body.chochrun-legacy .legacy-logout {
    border: 1px solid rgb(255 255 255 / 0.16);
    box-shadow: 0 2px 7px rgb(0 0 0 / 0.28);
    transition: filter 140ms ease, transform 140ms ease;
}

body.chochrun-legacy .legacy-login:hover,
body.chochrun-legacy .legacy-logout:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* Keep every public navigation item, including report and appeal, on the
   same line. Narrow viewports scroll the bar instead of wrapping it. */
body.chochrun-legacy #tabsWrapper {
    height: 50px;
}

body.chochrun-legacy #tabsWrapper > #mainwrapper {
    width: min(1280px, calc(100% - 32px));
    height: 50px;
}

body.chochrun-legacy #tabs {
    display: flex;
    float: none;
    align-items: stretch;
    height: 50px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

body.chochrun-legacy #tabs > ul {
    display: flex;
    flex: 1 0 auto;
    max-width: none;
    white-space: nowrap;
}

body.chochrun-legacy #tabs > ul > li {
    float: none;
    flex: 0 0 auto;
}

body.chochrun-legacy #tabs ul li a,
body.chochrun-legacy #tabs ul li.active a {
    padding-right: 9px;
    padding-left: 9px;
}

body.chochrun-legacy #tabs .legacy-auth {
    float: none;
    flex: 0 0 auto;
    height: 50px;
    margin-left: auto;
}

/* The legacy admin shortcut line otherwise escapes to the page header.
   Admin Panel and its internal tabs remain available in the main navbar. */
body.chochrun-legacy #tabs > #nav {
    display: none;
}

/* These duplicate the page's own H1 and consume another row below navbar. */
body.chochrun-legacy #content_title,
body.chochrun-legacy #breadcrumb {
    display: none;
}

/* TS3 bans still use the v1 table classes. Scope their dark compatibility
   palette to this page so the regular v2 ban list remains untouched. */
body.chochrun-legacy .chochrun-ts3bans table.listtable {
    border: 1px solid #49433e;
    background: #171719;
    color: #f4f4f5;
    font-size: 12px;
}

body.chochrun-legacy .chochrun-ts3bans td.listtable_top {
    height: auto;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #62594f;
    background: #2a2723;
    color: #ffffff;
}

body.chochrun-legacy .chochrun-ts3bans td.listtable_1,
body.chochrun-legacy .chochrun-ts3bans td.listtable_2 {
    padding: 0.5rem 0.7rem;
    border-color: #3f3f46;
    background: #1d1d20;
    color: #e7e5e4;
    font-size: 12px;
    line-height: 1.45;
}

body.chochrun-legacy .chochrun-ts3bans tr.tbl_out td,
body.chochrun-legacy .chochrun-ts3bans tr.tbl_hover td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #443b38;
    color: #f4f4f5 !important;
    font-size: 12px;
}

body.chochrun-legacy .chochrun-ts3bans td.listtable_1_permanent {
    background: #3a2022 !important;
}

body.chochrun-legacy .chochrun-ts3bans td.listtable_1_banned {
    background: #3b321d !important;
}

body.chochrun-legacy .chochrun-ts3bans td.listtable_1_unbanned {
    background: #17372a !important;
}

body.chochrun-legacy .chochrun-ts3bans tr.tbl_out:hover td,
body.chochrun-legacy .chochrun-ts3bans tr.tbl_hover td {
    filter: brightness(1.18);
}

body.chochrun-legacy .chochrun-ts3bans tr.tbl_out td:first-child,
body.chochrun-legacy .chochrun-ts3bans tr.tbl_hover td:first-child {
    border-left: 3px solid #e66b63;
}

body.chochrun-legacy .chochrun-ts3bans .ban-edit,
body.chochrun-legacy .chochrun-ts3bans .ban-edit a,
body.chochrun-legacy .chochrun-ts3bans .ban-edit span,
body.chochrun-legacy .chochrun-ts3bans font {
    color: #d4d4d8 !important;
}

body.chochrun-legacy .chochrun-ts3bans .ban-edit li a {
    border-bottom-color: #3f3f46;
}

@media (max-width: 1000px) {
    body.chochrun-legacy #tabsWrapper > #mainwrapper {
        width: calc(100% - 16px);
    }
}

body.chochrun-legacy [data-order-ready="false"][data-legacy-server-order="active-only"] {
    min-height: 5rem;
}

/* Utility .flex has author-level display:flex and otherwise overrides the
   browser's [hidden] rule on dashboard server rows. */
body.chochrun-legacy [data-legacy-server-order] > [hidden] {
    display: none !important;
}

body.chochrun-legacy .servers-grid > .card {
    background: #171719;
    border-color: #3f3f46;
}

body.chochrun-legacy .servers-grid [data-testid="server-host"] {
    color: #f4f4f5;
}

body.chochrun-legacy .servers-grid [data-testid="server-map"],
body.chochrun-legacy .servers-grid [data-testid="server-players"],
body.chochrun-legacy .servers-grid dt {
    color: #d4d4d8 !important;
}

body.chochrun-legacy .servers-grid .text-faint {
    color: #a1a1aa;
}

body.chochrun-legacy .servers-grid .text-muted {
    color: #c4c4cc;
}

body.chochrun-legacy .servers-grid .btn--secondary,
body.chochrun-legacy .servers-grid .btn--ghost {
    color: #f4f4f5;
    border-color: #71717a;
}

body.chochrun-legacy .chochrun-banlist {
    max-width: 1180px !important;
}

body.chochrun-legacy .chochrun-banlist__table {
    border-radius: 0;
    border-color: #4f463e;
    background: #1c1b1a;
}

body.chochrun-legacy .chochrun-banlist__table .table th {
    padding: 0.55rem 0.65rem;
    background: #2a2723;
    color: #f5f5f4;
    border-bottom: 1px solid #5f554d;
    font-size: 0.7rem;
    letter-spacing: 0.025em;
}

body.chochrun-legacy .chochrun-banlist__table .table td {
    padding: 0.55rem 0.65rem;
    color: #e7e5e4;
    border-bottom-color: #3f3a36;
    vertical-align: middle;
}

body.chochrun-legacy .chochrun-banlist__table .table tbody tr:nth-child(even) {
    background: #22201e;
}

body.chochrun-legacy .chochrun-banlist__table .table tbody tr:hover {
    background: #302c28;
}

body.chochrun-legacy .chochrun-banlist__table .ban-row--permanent { border-left: 4px solid #dc2626; }
body.chochrun-legacy .chochrun-banlist__table .ban-row--active { border-left: 4px solid #f59e0b; }
body.chochrun-legacy .chochrun-banlist__table .ban-row--expired { border-left: 4px solid #71717a; }
body.chochrun-legacy .chochrun-banlist__table .ban-row--unbanned { border-left: 4px solid #22c55e; }

body.chochrun-legacy .chochrun-banlist .filters-details,
body.chochrun-legacy .chochrun-banlist > .card:not(.chochrun-banlist__table) {
    border-radius: 2px;
}

@media (max-width: 768px) {
    body.chochrun-legacy .chochrun-banlist { padding: 0.75rem !important; }
    body.chochrun-legacy .chochrun-banlist .ban-card { background: #1c1b1a; }
}
