/* MAXROOSTER: public page refinements on top of Bootstrap components. */
@layer maxrooster {
    .site-body.home-body .new-rooster-grid {
        width: 100%;
        max-width: none;
        margin-inline: 0;
    }

    .site-body .lab-panel .trait-list {
        gap: 0;
        grid-template-rows: none;
        grid-auto-rows: minmax(57px, 1fr);
    }

    .site-body .lab-panel .trait-row[data-category] {
        min-height: 57px;
        padding-block: 8px;
    }

    /* Match the header controls without changing the spacing of the main nav. */
    .site-body .site-header .header-guest-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .site-body .site-header .header-account-actions :is(.header-login, .header-user-link, .header-search-toggle) {
        --bs-btn-color: #fff;
        --bs-btn-border-color: #ffffff70;
        --bs-btn-hover-bg: #ffc400;
        --bs-btn-hover-color: #171715;
        --bs-btn-hover-border-color: #ffc400;
        --bs-btn-active-bg: #ffc400;
        --bs-btn-active-color: #171715;
        --bs-btn-active-border-color: #ffc400;
        background: transparent;
        border-color: var(--bs-btn-border-color);
        border-radius: var(--bs-btn-border-radius);
        color: var(--bs-btn-color);
        min-height: 40px;
    }

    .site-body .site-header .header-account-actions :is(.header-login, .header-user-link, .header-search-toggle):is(:hover, .active, [aria-expanded="true"]) {
        background: #ffc400;
        border-color: #ffc400;
        color: #171715;
    }

    .site-body .site-header .header-account-actions .header-user-link { padding: 5px 9px; gap: 8px; }
    .site-body .site-header .header-user-link .header-user-avatar { width: 26px; height: 26px; }
    .site-body .site-header .header-user-copy {
        font: 400 12px/1.2 var(--mr-body-font, Arial, sans-serif);
        text-transform: none;
        letter-spacing: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .site-body .site-header .header-guest-actions > .btn { white-space: nowrap; }

    /* One input border and one focus ring. The icon is outside input flow. */
    .site-body .site-header .site-search-form {
        grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem) auto 44px;
        grid-template-areas: "query type submit close";
        align-items: stretch;
        gap: 10px;
    }
    .site-body .site-header .site-search-input-wrap {
        grid-area: query;
        display: block;
        position: relative;
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
        outline: 0;
        overflow: visible;
    }
    .site-body .site-header .site-search-input-wrap:focus-within { outline: 0; }
    .site-body .site-header .site-search-input-wrap > svg {
        position: absolute;
        inset: 50% auto auto 14px;
        transform: translateY(-50%);
        margin: 0;
        z-index: 1;
        pointer-events: none;
        stroke: #666;
    }
    .site-body .site-header .site-search-form :is(.form-control, .btn) { min-height: 44px; }
    .site-body .site-header .site-search-input-wrap .form-control {
        padding-inline: 42px 12px;
        height: 100%;
        margin: 0;
        width: 100%;
        font-size: 15px;
        font-weight: 400;
    }
    .site-body .site-header .site-search-form .form-control:focus {
        outline: 0;
        border-color: #b71912;
        box-shadow: 0 0 0 3px #e5261f26;
    }
    .site-body .site-header .site-search-form > select { grid-area: type; }
    .site-body .site-header .site-search-form > button[type="submit"] { grid-area: submit; font-size: 13px; padding-inline: 18px; }
    .site-body .site-header .site-search-form > .site-search-close { grid-area: close; width: 44px; padding: 0; justify-content: center; }
    .site-body .site-search-status:empty { margin: 0; min-height: 0; }

    .site-body.social-body .social-profile-link {
        transition: border-color .16s ease, box-shadow .16s ease;
    }
    .site-body.social-body .social-profile-link:is(:hover, :focus-visible) {
        border-color: #ffc400;
        box-shadow: inset 0 0 0 1px #ffc400;
    }
    .site-body.social-body .social-profile-link:focus-visible {
        outline: 2px solid #171715;
        outline-offset: 3px;
    }
    @media (prefers-reduced-motion: reduce) {
        .site-body.social-body .social-profile-link { transition: none; }
    }

    /* Member access pages share Bootstrap fields and a visible form hierarchy. */
    .site-body.member-auth-body .member-access-card {
        max-width: 600px;
        margin-inline: auto;
        padding: clamp(20px, 4vw, 38px);
        border: 1px solid #ded5c1;
        border-top: 4px solid #ffc400;
        border-radius: var(--bs-radius-7);
        box-shadow: 0 14px 36px #30220c0b;
    }
    .site-body.member-auth-body .member-access-heading {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 20px;
        border-bottom: 1px solid #ebe4d6;
    }
    .site-body.member-auth-body .member-access-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.85rem); line-height: 1.1; }
    .site-body.member-auth-body .member-access-heading .auth-brand-mark {
        display: grid;
        place-items: center;
        flex: 0 0 52px;
        height: 52px;
        margin: 0;
        border-radius: var(--bs-radius-5);
    }
    .site-body.member-auth-body .member-access-heading .auth-brand-mark img { width: 32px; height: 34px; }
    .site-body.member-auth-body .member-access-card .member-auth-form { gap: 16px; }
    .site-body.member-auth-body .member-access-card .form-label {
        display: grid;
        gap: 6px;
        color: #282724;
        font: 600 14px/1.4 var(--mr-body-font, Arial, sans-serif);
        letter-spacing: normal;
        text-transform: none;
    }
    .site-body.member-auth-body .member-access-card .form-label .form-control {
        min-height: 46px;
        margin-top: 0;
        font-weight: 400;
    }
    .site-body.member-auth-body .member-access-card .form-control:focus {
        outline: 0;
        border-color: #b71912;
        box-shadow: 0 0 0 3px #e5261f26;
    }
    .site-body.member-auth-body .member-access-card .member-check {
        display: flex;
        align-items: flex-start;
        gap: 9px;
        font: 400 13px/1.55 var(--mr-body-font, Arial, sans-serif);
        letter-spacing: normal;
        text-transform: none;
        margin: 0;
    }
    .site-body.member-auth-body .member-access-card .member-check .check { flex: 0 0 17px; width: 17px; height: 17px; margin: 2px 0 0; }
    .site-body.member-auth-body .member-login-options { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
    .site-body.member-auth-body .member-login-options .member-password-link { margin: 0; font-size: 13px; color: #a11913; }
    .site-body.member-auth-body .member-access-card .alert { display: grid; gap: 4px; }
    .site-body.member-auth-body .member-access-card .username-availability:empty { display: none; }

    /* Arena: a centered duel and matching widths through the ranking section. */
    .site-body.arena-body .arena-page-viewport { min-height: 0; padding-block: 0; }
    .site-body.arena-body .arena-page-shell {
        width: 100%;
        max-width: none;
        padding-block: clamp(24px, 3vw, 48px) clamp(40px, 5vw, 68px);
    }
    .site-body.arena-body .arena-page-stage { width: 100%; max-width: none; margin: 0; padding: 0; }
    .site-body.arena-body .arena-matchup { width: 100%; max-width: 920px; }
    .site-body.arena-body .arena-page-stage .arena-duel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: stretch;
        gap: clamp(8px, 2vw, 30px);
        width: 100%;
        margin: 0;
        padding: 6px 0 12px;
    }
    .site-body.arena-body .arena-fighter-slot { min-width: 0; }
    .site-body.arena-body .arena-duel .arena-rooster-card { display: flex; flex-direction: column; }
    .site-body.arena-body .arena-duel .fighter-art { flex: none; }
    .site-body.arena-body .arena-duel .fighter-info {
        flex: 1 0 auto;
        display: grid;
        align-items: center;
        min-height: clamp(56px, 6vw, 78px);
        padding: 10px clamp(5px, 1.5vw, 18px);
    }
    .site-body.arena-body .arena-duel .fighter-info h3 { font-size: clamp(15px, 2.1vw, 29px); }
    .site-body.arena-body .arena-duel .versus {
        align-self: center;
        display: grid;
        place-items: center;
        min-height: 0;
        padding: 0;
        margin: 0;
    }
    .site-body.arena-body .arena-duel .arena-versus-badge {
        display: grid;
        place-items: center;
        width: clamp(38px, 6vw, 72px);
        aspect-ratio: 1;
        padding: 0;
        border-radius: 50%;
        border: 2px solid #241a09;
        outline: 1px solid #ffc400;
        background: #ffc400;
        box-shadow: 0 5px 16px #0009;
        color: #171715;
        font: 400 clamp(20px, 3vw, 37px)/1 var(--mr-heading-font, Impact, 'MR-heading-fallback', sans-serif);
        letter-spacing: .02em;
    }
    .site-body.arena-body .arena-login-note { display: block; text-align: center; margin: 14px auto 0; }
    .site-body.arena-body .arena-login-note .btn { --bs-btn-color: #fff; --bs-btn-border-color: #fff8; --bs-btn-hover-bg: #ffc400; --bs-btn-hover-color: #171715; --bs-btn-hover-border-color: #ffc400; }
    .site-body.arena-body .arena-rankings .ranking-heading { flex-wrap: wrap; gap: 12px 18px; }
    .site-body.arena-body .arena-rankings .ranking-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        margin-inline: 0;
        gap: clamp(6px, 1vw, 12px);
        background: none;
    }
    .site-body.arena-body .arena-rankings .ranking-tabs .nav-link {
        width: 100%;
        min-height: 44px;
        padding: 10px 6px;
        border-radius: var(--bs-radius-5);
        white-space: normal;
        text-align: center;
    }
    .site-body.arena-body .arena-rankings .professional-table-shell {
        width: 100%;
        max-width: none;
        max-height: none;
        margin-inline: 0;
        scrollbar-gutter: auto;
        overflow-x: auto;
    }
    .site-body.arena-body .arena-rankings .professional-table { width: 100%; min-width: 840px; max-width: none; }
    .site-body.arena-body .arena-rankings .ranking-col-rank { width: 7%; }
    .site-body.arena-body .arena-rankings .ranking-col-rooster { width: 27%; }
    .site-body.arena-body .arena-rankings .ranking-col-author { width: 17%; }
    .site-body.arena-body .arena-rankings :is(.ranking-col-score,.ranking-col-votes) { width: 9%; }
    .site-body.arena-body .arena-rankings :is(.ranking-col-views,.ranking-col-likes) { width: 8%; }
    .site-body.arena-body .arena-rankings .ranking-col-date { width: 15%; }
    .site-body.arena-body .arena-rankings .ranking-number { text-align: right; font-variant-numeric: tabular-nums; }
    .site-body.arena-body .arena-rankings .numbered-pagination { border-top: 0; padding-top: 0; }

    /* Compact, low-noise controls inside posts and replies. */
    .site-body.henhouse-body .community-content > .henhouse-search-card { margin: 0 0 16px; }
    .site-body.henhouse-body .henhouse-search-card .henhouse-search-form > .btn { width: 44px; min-height: 44px; }
    .site-body.henhouse-body .henhouse-search-card .form-control { font-size: 14px; }
    .site-body.henhouse-body .henhouse-feed-order-card [data-feed-order] { display: grid; gap: 6px; }
    .site-body.henhouse-body .henhouse-feed-order-card [data-feed-order] .btn {
        justify-content: flex-start;
        min-height: 42px;
        color: #282724;
        background: #f4f3ef;
    }
    .site-body.henhouse-body .henhouse-feed-order-card [data-feed-order] .btn:is(:hover, .active) { background: #171715; color: #ffc400; }
    .site-body.henhouse-body .henhouse-trends .list-group-item { margin: 0; border-color: #e9e7df; border-block-end-width: 1px; padding: 10px 4px; background: #fff; }
    .site-body.henhouse-body .henhouse-trends .list-group-item:hover { background: #f7f5ef; }
    .site-body.henhouse-body .henhouse-trends .list-group-item > span { min-width: 0; overflow-wrap: anywhere; }
    .site-body.henhouse-body .henhouse-trends .badge { white-space: nowrap; font-size: 11px; margin: 0; }
    .site-body.henhouse-body .henhouse-post-permalink { margin-inline-start: auto; color: #62686b; font-size: 11px; white-space: nowrap; }
    .site-body.henhouse-body .henhouse-post-permalink:hover { color: #a11913; }
    .site-body.henhouse-body .report-menu { display: flex; align-items: center; flex: none; margin: 0; }
    .site-body.henhouse-body .report-menu > .report-menu-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
        color: #565957;
        background: transparent;
    }
    .site-body.henhouse-body .report-menu > .report-menu-trigger:hover,
    .site-body.henhouse-body .report-menu[open] > .report-menu-trigger { color: #171715; background: #f0eee8; }
    .site-body.henhouse-body .henhouse-post .henhouse-post-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
    .site-body.henhouse-body .henhouse-post .henhouse-post-actions .btn {
        min-height: 32px;
        padding: 5px 9px;
        gap: 6px;
        border-radius: var(--bs-radius-5);
        font-size: 11px;
    }
    .site-body.henhouse-body .henhouse-comments-panel {
        scroll-margin-top: calc(var(--site-header-height, 80px) + 16px);
        margin: 12px 0 0;
        padding: 14px 0 0;
        background: transparent;
        border: 0;
        border-top: 1px solid #e7e5df;
        border-radius: 0;
    }
    .site-body.henhouse-body .henhouse-comments-toolbar { flex-flow: row wrap; align-items: center; justify-content: space-between; margin: 0 0 12px; }
    .site-body.henhouse-body .henhouse-comments-toolbar > strong { display: flex; align-items: center; gap: 6px; }
    .site-body.henhouse-body .henhouse-comments-toolbar .btn { min-height: 32px; padding: 5px 9px; font-size: 11px; }
    .site-body.henhouse-body .henhouse-comments-toolbar .btn.is-active { color: #171715; background: #fff2bf; border-color: #ead38a; }
    .site-body.henhouse-body .henhouse-comment-composer { border: 0; padding: 0; margin: 0 0 10px; background: transparent; }
    .site-body.henhouse-body .henhouse-comment-composer > footer { margin-top: 6px; }
    .site-body.henhouse-body .henhouse-comment-composer .emoji-picker-toggle { width: 32px; height: 32px; min-height: 32px; padding: 0; }
    .site-body.henhouse-body .henhouse-comments-list { border: 0; margin: 0; }
    .site-body.henhouse-body .henhouse-comments-list .henhouse-reply {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 10px;
        padding: 12px 0;
        margin: 0;
        background: #fff;
        border: 0;
        border-top: 1px solid #ebe9e2;
    }
    .site-body.henhouse-body .henhouse-reply > .henhouse-avatar { width: 32px; height: 32px; }
    .site-body.henhouse-body .henhouse-reply .henhouse-post-content > header { gap: 6px; margin: 0 0 5px; }
    .site-body.henhouse-body .henhouse-reply .henhouse-post-content > p { margin-bottom: 5px; }
    .site-body.henhouse-body .henhouse-reply .henhouse-post-actions { border: 0; margin: 0; padding: 0; }
    .site-body.henhouse-body .henhouse-back-feed { margin-bottom: 12px; }

    /* Empty activity panels are cards, not rows inside scrolling tables. */
    .site-body.notifications-body .member-activity-panel {
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0 0 20px;
        background: #fff;
        border: 1px solid #dedcd5;
        border-radius: var(--bs-radius-7);
    }
    .site-body.notifications-body .member-activity-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        background: #faf9f5;
    }
    .site-body.notifications-body .member-activity-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); }
    .site-body.notifications-body .member-activity-empty { padding: 24px 20px; }
    .site-body.notifications-body .member-activity-empty strong { font-size: 16px; }
    .site-body.notifications-body .member-activity-empty p { color: #5d615d; margin: 6px 0 0; }
    .site-body.notifications-body .member-activity-empty .btn { margin-top: 14px; }
    .site-body.notifications-body .member-activity-table-wrap { width: 100%; max-height: none; overflow-x: auto; scrollbar-gutter: auto; }
    .site-body.notifications-body .member-activity-panel .table { width: 100%; font-size: 13px; }
    .site-body.notifications-body .member-activity-panel .notification-table { min-width: 700px; }
    .site-body.notifications-body .member-activity-panel .arena-picks-table { min-width: 460px; }
    .site-body.notifications-body .member-activity-panel .table :is(th, td) { padding: 12px 16px; vertical-align: middle; }
    .site-body.notifications-body .member-activity-panel .table th { background: #f4f2eb; color: #282724; white-space: nowrap; }
    .site-body.notifications-body .member-activity-panel .table tr:last-child td { border-bottom: 0; }
    .site-body.notifications-body .member-activity-panel .table time { white-space: nowrap; color: #535650; }
    .site-body.notifications-body .member-activity-panel .table .is-unread > td { background: #fff9e3; }
    .site-body.notifications-body .member-activity-panel .arena-pick-link { display: flex; align-items: center; gap: 10px; color: #373a35; }
    .site-body.notifications-body .member-activity-panel .arena-pick-link.is-picked { color: #a11913; font-weight: 700; }
    .site-body.notifications-body .member-activity-panel .arena-pick-link img { object-fit: cover; flex: none; border-radius: var(--bs-radius-5); }
    .site-body.notifications-body .member-activity-panel .numbered-pagination { border: 0; margin: 0; padding: 0; }

    @media (width < 768px) {
        .site-body .site-header .site-search-form {
            grid-template-columns: minmax(0, 1fr) auto 44px;
            grid-template-areas: "query query close" "type submit submit";
        }
        .site-body.arena-body .arena-page-header { margin-bottom: 18px; }
    }
}
