/*
 * App-level styles: the shell, domain widgets and a few utilities.
 * Design tokens live in css/theme-tokens.css; corrections to Bootstrap and
 * Havit live in css/theme-bootstrap.css. Both load before this file.
 */

/* ---------------- Blazor boilerplate ---------------- */

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--cf-success);
}

.invalid {
    outline: 2px solid var(--cf-error);
}

.validation-message {
    color: var(--cf-error);
    font-weight: 600;
}

.blazor-error-boundary {
    background: var(--cf-salmon-surface);
    border: var(--cf-border);
    padding: 1rem;
    color: var(--cf-ink);
    font-weight: 600;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

/* ---------------- utilities ---------------- */

/*
 * The signature accent: a wavy black underline. Marks the active nav item and
 * section headings, exactly as on the club website.
 */
.wavy {
    text-decoration: underline wavy var(--cf-ink);
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
    text-decoration-skip-ink: none;
}

/* opt-in offset shadow for anything pressable that is not a button or a card */
.cf-pressable {
    box-shadow: var(--cf-shadow);
    transition: var(--cf-transition);
}

.cf-pressable:hover {
    box-shadow: var(--cf-shadow-lg);
    transform: var(--cf-lift);
}

.cf-pressable:active {
    box-shadow: var(--cf-shadow-sm);
    transform: var(--cf-press);
}

/*
 * Reading measure for the public pages. Manage pages stay full-bleed on purpose —
 * they are wide data grids that want the room.
 */
.content-width {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
}

/*
 * Square chess-piece indicator. The white one carries a black border because a
 * white disc on a white page is invisible.
 */
.piece {
    display: inline-block;
    flex: 0 0 auto;
    width: .85rem;
    height: .85rem;
    border: 2px solid var(--cf-line);
}

/* piece colours are chess, not theme: they stay white and black in both themes */
.piece--white {
    background-color: var(--cf-piece-white);
}

.piece--black {
    background-color: var(--cf-piece-black);
}

.piece--lg {
    width: 1.25rem;
    height: 1.25rem;
}

/* square accent tile behind an icon; replaces the old tinted circles */
.stat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border: var(--cf-border);
    background-color: var(--cf-blue);
    color: var(--cf-on-accent);
}

.stat-chip--sm {
    width: 2rem;
    height: 2rem;
}

/*
 * Bootstrap Icons sets `vertical-align: -.125em` on .bi::before, which pushes the
 * glyph below the middle of a centred box. Neutralise it and let flex do the work.
 */
.stat-chip > i,
.stat-chip > .bi {
    display: block;
    line-height: 1;
}

.stat-chip > i::before,
.stat-chip > .bi::before {
    display: block;
    vertical-align: baseline;
    line-height: 1;
}

.stat-chip--pink {
    background-color: var(--cf-pink);
}

.stat-chip--yellow {
    background-color: var(--cf-yellow);
}

.stat-chip--salmon {
    background-color: var(--cf-salmon);
}

/* ---------------- navbar ---------------- */

.app-navbar-shell {
    --cf-navbar-height: 4rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--cf-paper);
}

.app-navbar {
    --bs-navbar-padding-y: 0;
    --bs-navbar-padding-x: 0;
    --bs-navbar-nav-link-padding-x: 1.25rem;
    --bs-navbar-color: var(--cf-ink);
    --bs-navbar-hover-color: var(--cf-ink);
    --bs-navbar-active-color: var(--cf-ink);
    --bs-navbar-toggler-border-color: var(--cf-line);
    --bs-navbar-toggler-border-radius: 0;
    --bs-navbar-toggler-focus-width: 0;
    border-bottom: var(--cf-border);
    min-height: var(--cf-navbar-height);
}

.app-navbar > .container-fluid {
    padding: 0;
    align-items: stretch;
    min-height: var(--cf-navbar-height);
}

/* the wordmark: a pink segment, type only */
.app-brand {
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 0;
    background: var(--cf-pink);
    color: var(--cf-on-accent);
    font-family: var(--cf-font-head);
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: var(--cf-tracking-ui);
    border-right: var(--cf-border);
    white-space: nowrap;
    width: 215px;
}

.app-brand-logo {
    display: block;
    height: calc(var(--cf-navbar-height) - 0.75rem);
    width: auto;
    max-width: 100%;
}

.app-navbar .nav-link {
    display: flex;
    align-items: center;
    font-family: var(--cf-font-head);
    font-weight: 600;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: var(--cf-tracking-ui);
    color: var(--cf-ink);
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: var(--cf-ink);
    text-decoration: underline wavy var(--cf-ink);
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
    text-decoration-skip-ink: none;
}

/* the account toggle is an <a> without href, so it needs the pointer set explicitly */
.app-user-menu > .nav-link {
    font-size: 1.75rem;
    cursor: pointer;
}

/* light/dark switch: sits right of the account icon on desktop, left of the burger on mobile */
.app-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem 0 .25rem;
    border: 0;
    background: transparent;
    color: var(--cf-ink);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.app-theme-toggle:hover {
    color: var(--cf-link);
}

.app-theme-toggle:focus-visible {
    outline: 3px solid var(--cf-line);
    outline-offset: -3px;
}

/* the icon and the label name the theme a click switches to */
:root[data-bs-theme="dark"] .app-theme-toggle-to-dark,
:root:not([data-bs-theme="dark"]) .app-theme-toggle-to-light {
    display: none;
}


.app-navbar .navbar-toggler {
    border: 0;
    border-left: var(--cf-border);
    border-radius: 0;
    padding: 0 1rem;
    margin-left: auto;
}

.app-navbar .navbar-toggler:focus-visible {
    outline: 3px solid var(--cf-line);
    outline-offset: -3px;
}

/*
 * Set on the icon span itself, not inherited from the bar: Bootstrap's
 * [data-bs-theme=dark] .navbar-toggler-icon declares the variable right there and
 * would otherwise swap in its own thin grey burger.
 */
.app-navbar .navbar-toggler-icon {
    --bs-navbar-toggler-icon-bg: var(--cf-icon-menu);
}

/* the burger turns into a cross while the menu is open */
.app-navbar .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    --bs-navbar-toggler-icon-bg: var(--cf-icon-menu-close);
}

.app-navbar .navbar-collapse {
    padding-inline: 1rem;
}

/*
 * mobile: full-width stacked rows, like the site's mobile menu. The open menu is
 * a fixed sheet starting right below the bar, so it covers the page instead of
 * pushing it down and the bar itself never moves.
 */
@media (max-width: 991.98px) {
    .app-brand {
        flex: 1;
        border-right: 0;
    }

    /* a bar segment like the burger, placed before it */
    .app-theme-toggle {
        order: 1;
        padding: 0 1rem;
        border-left: var(--cf-border);
    }

    .app-navbar .navbar-toggler {
        order: 2;
    }

    .app-navbar .navbar-collapse {
        padding-inline: 0;
        position: fixed;
        top: var(--cf-navbar-height);
        right: 0;
        bottom: 0;
        left: 0;
        flex-direction: column;
        /* Bootstrap centres .navbar-collapse children; the rows want full width */
        align-items: stretch;
        background: var(--cf-paper);
        border-top: var(--cf-border);
        overflow-y: auto;
    }

    /*
     * Bootstrap animates height (width, for collapse-horizontal) on .collapsing,
     * which fights the fixed inset; hold the sheet at full size and fade instead.
     */
    .app-navbar .navbar-collapse.collapsing {
        width: auto !important;
        height: auto !important;
        overflow-y: auto;
        transition: none;
    }

    /* Bootstrap only un-hides the sheet; it still has to be the flex column */
    .app-navbar .navbar-collapse.show,
    .app-navbar .navbar-collapse.collapsing {
        display: flex;
    }

    .app-navbar .navbar-collapse.show {
        animation: cf-menu-in .18s ease-out;
    }

    /*
     * The two navs dissolve so that every link is a direct flex child of the
     * sheet: all items then share the free height equally, however they are
     * split between the left and right nav.
     */
    .app-navbar .navbar-collapse .navbar-nav {
        display: contents;
    }

    .app-navbar .navbar-collapse .nav-link {
        flex: 1;
        min-height: 3.25rem;
        padding: .9rem 1.25rem;
        font-size: 1.1rem;
        border-bottom: var(--cf-border);
    }

    /*
     * The user dropdown is a desktop affordance only: drop the icon toggle and
     * dissolve the menu so its items become ordinary rows of the sheet.
     */
    .app-user-menu > .nav-link {
        display: none;
    }

    .app-user-menu,
    .app-user-menu .dropdown-menu,
    .app-user-menu .dropdown-menu > li {
        display: contents !important;
    }

    .app-user-menu .dropdown-item {
        display: flex;
        align-items: center;
        flex: 1;
        min-height: 3.25rem;
        padding: .9rem 1.25rem;
        font-family: var(--cf-font-head);
        font-weight: 600;
        font-size: 1.1rem;
        text-transform: uppercase;
        letter-spacing: var(--cf-tracking-ui);
        color: var(--cf-ink);
        background: transparent;
        border-bottom: var(--cf-border);
    }

    .app-user-menu .dropdown-item:hover,
    .app-user-menu .dropdown-item.active {
        color: var(--cf-ink);
        background: transparent;
        text-decoration: underline wavy var(--cf-ink);
        text-decoration-thickness: 2px;
        text-underline-offset: 8px;
        text-decoration-skip-ink: none;
    }
}

@keyframes cf-menu-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---------------- app shell ---------------- */

/*
 * A bounded viewport with inner scroll regions, not document scroll: the
 * fullscreen pairing board and both sidebar layouts size themselves against a
 * height-bounded ancestor.
 */
.page-wrapper {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100dvh;
    max-height: 100dvh;
    background: var(--cf-paper);
}

.main-container {
    height: 100%;
    width: 100%;
}

.page-content {
    height: 100%;
    max-width: 100dvw;
    padding: 2rem;
    overflow: auto;
    background-color: var(--cf-canvas);
}

.page-content:has(.sidebar-layout-container) {
    padding: 0;
}

@media (max-width: 500px) {
    /*
     * .75rem inline, not less: it is half of Bootstrap's widest gutter, so a .row
     * laid directly on the page cannot pull its negative margins past the edge.
     */
    .page-content {
        padding: 1.5rem 0.75rem;
    }
}

.sidebar-layout-container {
    height: 100%;
    display: grid;
    max-height: 100%;
    grid-template-columns: 215px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.sidebar-layout-content {
    padding: 1rem;
    overflow: auto;
    width: 100%;
}

.tab-content {
    padding-top: 1.5rem;
}

/* 767.98px, not 768px: Havit switches the sidebar to navbar mode on Bootstrap's
   md breakpoint (d-md-none on its toggler), and the two must agree exactly */
@media (max-width: 767.98px) {
    .tab-content {
        padding-top: 1rem;
    }

    .sidebar-layout-container {
        position: relative;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }
}

body {
    font-optical-sizing: auto;
}

/* ---------------- sidebar ---------------- */

.layout-sidebar {
    background-color: var(--cf-yellow-surface) !important;
    padding: 0;
    border-right: var(--cf-border);
}

.sidebar-header {
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    align-self: center;
    font-family: var(--cf-font-head);
    font-size: 1.15rem;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    border-bottom: var(--cf-border);
    padding: .75rem;
    min-height: 5rem;
    align-content: center;
}

/*
 * mobile: the submenu behaves like the mobile navbar one level down. Its header
 * keeps a fixed height at the top of the content area and the item sheet opens
 * over the page below it, with the items sharing that height equally.
 */
@media (max-width: 767.98px) {
    .layout-sidebar {
        --cf-submenu-header-height: 3.75rem;
        padding: 0;
        border-right: 0;
        border-bottom: var(--cf-border);
    }

    .layout-sidebar .hx-sidebar-header {
        height: var(--cf-submenu-header-height);
        padding-right: .75rem;
    }

    /* the title no longer carries the rule; the sidebar's own bottom border does */
    .layout-sidebar .sidebar-header {
        display: flex;
        align-items: center;
        min-width: 0;
        height: 100%;
        padding-block: 0;
        border-bottom: 0;
    }

    /* Havit's toggler is a .btn, so it arrives with a white fill and an offset shadow */
    .layout-sidebar .hx-sidebar-navbar-toggler {
        --bs-btn-bg: transparent;
        --bs-btn-hover-bg: transparent;
        --bs-btn-color: var(--cf-ink);
        --bs-btn-hover-color: var(--cf-ink);
        flex-shrink: 0;
    }

    .layout-sidebar .hx-sidebar-navbar-toggler[aria-expanded="true"] .bi-list::before {
        content: "\f659"; /* bi-x-lg */
    }

    /*
     * Havit puts .position-relative on .nav-menu for its desktop collapse handle,
     * which is hidden here; dropping it lets the sheet size itself against the
     * whole content area instead of against the header strip.
     */
    .layout-sidebar .nav-menu {
        position: static !important;
    }

    /* the sheet: pinned under the header, down to the bottom of the content area */
    .layout-sidebar .hx-sidebar-collapse {
        position: absolute;
        top: calc(var(--cf-submenu-header-height) + var(--cf-border-width));
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 10;
        background: var(--cf-yellow-surface);
        overflow-y: auto;
    }

    .layout-sidebar .hx-sidebar-collapse.show,
    .layout-sidebar .hx-sidebar-collapse.collapsing {
        display: flex;
    }

    /* the insets already give the sheet its height; Bootstrap's must not fight them */
    .layout-sidebar .hx-sidebar-collapse.collapsing {
        height: auto !important;
        overflow-y: auto;
        transition: none;
    }

    .layout-sidebar .hx-sidebar-collapse.show {
        animation: cf-menu-in .18s ease-out;
    }

    /* dissolve the wrappers so every item is a direct flex child of the sheet */
    .layout-sidebar .hx-sidebar-body,
    .layout-sidebar .hx-sidebar-body .nav,
    .layout-sidebar .hx-sidebar-item-highlight-on-active-child {
        display: contents;
    }

    .layout-sidebar .hx-sidebar-collapse .hx-sidebar-item {
        display: flex;
        align-items: center;
        flex: 1;
        min-height: 3.25rem;
    }
}

/* ---------------- tournament widgets ---------------- */

.tournament-round-table {
    max-width: max-content;
}

.game-result-selector {
    min-width: 93px;
    width: 93px;
    max-width: 93px;
}

/* HxSelect puts CssClass on its wrapper div, so reach the <select> inside it */
.game-result-selector .form-select {
    background-image: none;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    text-align: center;
    text-align-last: center;
    font-size: 1.3rem;
}

.game-result-selector .form-select option {
    text-align: center;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 4rem;
    row-gap: 0.75rem;
    justify-content: center;
}

@media (max-width: 1600px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 500px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.pairing-container {
    max-width: fit-content;
    margin-top: 1rem;
    display: flex;
    justify-content: start;
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: fit-content;
    margin-bottom: 1.5rem;
}

/*
 * A pairing is a data surface, not a pressable one: bordered and flat, with the
 * table number carried in a pink band (the card/date-rail pattern from the site).
 */
.pairing {
    flex: 0 1 404px;
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: stretch;
    background: var(--cf-paper);
    border: var(--cf-border);
}

.pairing--played {
    background: var(--cf-blue-tint);
}

.pairing > div:nth-child(2) {
    padding: .5rem 1rem;
    align-self: center;
}

.pairing > div:nth-child(3) {
    padding: .5rem;
    display: grid;
    place-items: center;
}

.pairing-table-number {
    display: grid;
    place-items: center;
    min-width: 3rem;
    padding: .5rem .75rem;
    font-family: var(--cf-font-head);
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    background: var(--cf-pink);
    color: var(--cf-on-accent);
    border-right: var(--cf-border);
}

.player-table-info {
    display: grid;
    grid-template-columns: 1fr auto;
    flex: 0 1 297px;
    gap: 1.25rem;
    align-items: center;
    background: var(--cf-paper);
    border: var(--cf-border);
    padding: 0.5rem 1rem;
}

/* secondary metric next to a player's name */
.elo {
    font-size: .75rem;
    color: var(--cf-muted);
}

/* Elo gained or lost in a tournament, beside the new rating in the standings */
.elo-delta {
    font-size: .7rem;
}

.elo-delta--up {
    color: var(--cf-success);
}

.elo-delta--down {
    color: var(--cf-error);
}

/*
 * On a phone a pairing gets the whole line: the rail shrinks, the paddings
 * tighten and the name column is allowed to give way, so the card never has to
 * push past the screen to fit its result control.
 */
@media (max-width: 575.98px) {
    .pairing-container {
        width: 100%;
        max-width: 100%;
    }

    .pairing {
        flex: 1 1 100%;
        grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    }

    .pairing-table-number {
        min-width: 0;
        padding: .5rem .25rem;
        font-size: 1.15rem;
    }

    .pairing > div:nth-child(2) {
        padding: .5rem .6rem;
    }

    .pairing > div:nth-child(3) {
        padding: .35rem;
    }

    .player-table-info {
        flex: 1 1 100%;
        gap: .75rem;
    }
}

:where(:fullscreen) .pairing-container {
    justify-content: center;
    padding: 2rem;
}

:where(:fullscreen) {
    background: var(--cf-paper);
}

.manage-tournament-layout-container {
    display: grid;
    grid-template-columns: auto 1fr;
}

/* ---------------- misc ---------------- */

.description-textarea {
    min-height: 300px !important;
}

.description {
    h1, h2, h3, h4, h5 {
        font-size: 1.2rem;
    }
}

.date-input-group {
    display: grid !important;
    /* the 3px borders and the picker icon eat into the field, so both columns
       need more room than the old 1px-border sizing allowed; minmax lets the
       pair shrink instead of pushing the form off a narrow screen */
    grid-template-columns: minmax(0, 140px) minmax(0, 125px);
}

/* a start/end pair sits side by side while there is room and stacks when there is not */
.date-range-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.rank-column {
    min-width: 70px;
    width: 70px;
    max-width: 70px;
    font-family: var(--cf-font-head);
    font-weight: 600;
}

.modal-backdrop {
    --bs-backdrop-bg: var(--cf-scrim);
    --bs-backdrop-opacity: 0.35;
}

/* cards that are links carry the offset shadow; static ones stay flat */
.club-card {
    cursor: pointer;
}

/* ---------------- record lists (after the club site's EventCard) ---------------- */

/*
 * A list of linked records reads as a stack of cards rather than table rows: each
 * one framed, separated by real space, and pressable — so it carries the offset
 * shadow the way a linked Card does on the club website.
 */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    --bs-list-group-border-width: 0;
}

.event-list > .list-group-item,
.event-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch;
    margin: 0;
    padding: 0;
    border: var(--cf-border);
    border-radius: 0;
    background: var(--cf-paper);
    color: var(--cf-ink);
    box-shadow: var(--cf-shadow);
    transition: var(--cf-transition);
    cursor: pointer;
}

.event-list > .list-group-item:hover,
.event-card:hover {
    background: var(--cf-paper);
    box-shadow: var(--cf-shadow-lg);
    transform: var(--cf-lift);
}

.event-list > .list-group-item:active,
.event-card:active {
    box-shadow: var(--cf-shadow-sm);
    transform: var(--cf-press);
}

/* the date rail: a coloured block carrying month / day / year in the display face */
.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    padding: 1rem .75rem;
    background: var(--cf-pink);
    color: var(--cf-on-accent);
    border-right: var(--cf-border);
    font-family: var(--cf-font-head);
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
}

.event-date-month {
    font-size: 1.25rem;
    text-transform: uppercase;
}

.event-date-day {
    font-size: 2.5rem;
}

.event-date-year {
    font-size: 1.05rem;
    font-weight: 400;
}

.event-card--sm .event-date {
    width: 76px;
    padding: .5rem;
}

.event-card--sm .event-date-month { font-size: .95rem; }
.event-card--sm .event-date-day { font-size: 1.6rem; }
.event-card--sm .event-date-year { font-size: .8rem; }
.event-card--sm .event-body { padding: .6rem .9rem; }
.event-card--sm .event-title { font-size: 1rem; }

.event-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    padding: 1.25rem 1.5rem;
    min-width: 0;
}

.event-title {
    font-family: var(--cf-font-head);
    font-weight: 600;
    font-size: 1.15rem;
}

.event-meta {
    font-size: .95rem;
    color: var(--cf-muted);
}

/* below sm the rail becomes a band above the content, as on the club site */
@media (max-width: 575.98px) {
    .event-list > .list-group-item,
    .event-card {
        grid-template-columns: 1fr;
    }

    .event-date {
        flex-direction: row;
        gap: .5rem;
        width: 100%;
        padding: .5rem 1rem;
        border-right: 0;
        border-bottom: var(--cf-border);
    }

    .event-date-month,
    .event-date-day,
    .event-date-year {
        font-size: 1.1rem;
    }

    /* .event-card--sm sets a 76px rail; the stacked band has to win over it */
    .event-card--sm .event-date {
        width: 100%;
        padding: .5rem 1rem;
    }

    .event-card--sm .event-date-month,
    .event-card--sm .event-date-day,
    .event-card--sm .event-date-year {
        font-size: 1rem;
    }
}

/* ---------------- filter bar ---------------- */

/*
 * Count badge beside a search box. Both stretch to the same line so the badge
 * reads as a control of equal weight rather than a label floating next to one.
 */
.filter-bar {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar > * {
    margin-bottom: 0;
}

.filter-bar .badge {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
}

.filter-bar .form-control {
    height: 100%;
}

/* ---------------- stat tiles ---------------- */

/*
 * A row of small metric cards. Sized by content rather than a fixed 140px so a
 * value like "54,2%" cannot break across two lines.
 */
.stat-tile {
    flex: 0 0 auto;
    min-width: 150px;
}

.stat-tile .card-body {
    padding: 1rem .75rem;
}

.stat-value {
    white-space: nowrap;
    font-family: var(--cf-font-head);
    color: var(--cf-ink);
}

/*
 * Win / draw / loss keep a semantic tint, reusing the tones the theme already
 * defines for validation rather than Bootstrap's off-palette green and red.
 */
.stat-value--win {
    color: var(--cf-success);
}

.stat-value--draw {
    color: var(--cf-muted);
}

.stat-value--loss {
    color: var(--cf-error);
}

.stat-value--elo {
    color: var(--cf-link);
}

/*
 * A table inside a card is already framed by the card, so the wrapper's own
 * border would draw a second rule just inside the first.
 */
.card-body > .table-responsive,
.card-body > .hx-grid-container {
    border: 0;
}
