/* ---------- Theme: Alchemists "Basketball" (light) ----------
   Colors, type and components ported from the Alchemists HTML template
   (scss/config/_variables-basketball.scss). Bootstrap 5.1 is re-colored here.
   A few values are darker than the template's so text stays readable on white. */
:root {
    /* The primary color and everything derived from it. These are the defaults (yellow); a team's
       color replaces all of them (Data/TeamColors.cs, applied in MainLayout and TeamTheme). */
    --fc-primary: #ffdc11;       /* $color-primary: highlights, active states */
    --fc-primary-dark: #ffcc00;  /* $color-primary-darken: hover fills */
    --fc-on-primary: #1e2024;    /* text on a primary fill */
    --fc-on-primary-dark: #1e2024;
    --fc-primary-on-dark: #ffdc11; /* primary as text on the dark bands */
    --fc-primary-tint: #fffbe0;  /* pale background: info alerts, selected rows */
    --fc-primary-tint-border: #f2e39a;
    --fc-primary-ring: rgba(255, 204, 0, 0.45);
    --fc-dark: #1e2024;          /* $color-dark: header, hero bands */
    --fc-dark-2: #292c31;        /* $color-dark-lighten */
    --fc-slate: #31404b;         /* $color-2: headings, primary buttons */
    --fc-orange: #ff7e1f;        /* $color-3 */
    --fc-purple: #9a66ca;        /* $color-4 */
    --fc-bg: #edeff4;            /* $body-bg-color */
    --fc-surface: #fff;          /* $card-bg */
    --fc-surface-2: #f5f7f9;     /* $table-bg-hover / thead */
    --fc-border: #e4e7ed;        /* $card-border-color */
    --fc-border-strong: #dbdfe6;
    --fc-text: #4f535a;          /* template uses #9a9da2; darkened for contrast */
    --fc-muted: #6b6f76;
    --fc-on-dark-muted: #9a9da2; /* $color-gray, fine on the dark bands */
    --fc-success: #24d9b0;
    --fc-info: #0cb2e2;
    --fc-danger: #f34141;
    --fc-danger-text: #d12f2f;
    --fc-font-base: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    --fc-font-accent: 'Montserrat', sans-serif;
    --fc-radius: 4px;
    /* Fine diagonal texture on the dark bands, standing in for the template's halftone pattern image. */
    --fc-dark-texture: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 8px);
    color-scheme: light;
}

html, body {
    font-family: var(--fc-font-base);
    font-size: 15px;
}

body {
    background-color: var(--fc-bg);
    color: var(--fc-text);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--fc-font-accent);
    color: var(--fc-slate);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1, .h1 {
    font-weight: 800;
}

h2, h3, h4, h5, h6, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
}

a, .btn-link {
    color: var(--fc-slate);
    font-weight: 600;
    text-decoration: none;
}

    a:hover, .btn-link:hover {
        color: var(--fc-dark);
        text-decoration: underline;
        text-decoration-color: var(--fc-primary-dark);
        text-decoration-thickness: 2px;
        text-underline-offset: 3px;
    }

hr {
    color: var(--fc-border-strong);
    opacity: 1;
}

dt {
    font-family: var(--fc-font-accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--fc-slate);
    font-weight: 700;
}

code {
    color: #b0461a;
}

.text-muted {
    color: var(--fc-muted) !important;
}

.text-danger {
    color: var(--fc-danger-text) !important;
}

.text-success {
    color: #148a6f !important;
}

/* ---------- Buttons (Alchemists: Montserrat, uppercase, 2px corners) ---------- */
.btn {
    font-family: var(--fc-font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: 2px;
    padding: 0.75rem 1.6rem;
    border-width: 1px;
}

.btn-sm {
    font-size: 0.7rem;
    padding: 0.5rem 0.9rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--fc-slate);
    border-color: var(--fc-slate);
}

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
        color: var(--fc-on-primary-dark);
        background-color: var(--fc-primary-dark);
        border-color: var(--fc-primary-dark);
    }

    .btn-primary:disabled, .btn-primary.disabled {
        color: #fff;
        background-color: #8a949b;
        border-color: #8a949b;
    }

/* Primary-color call-to-action, used on the dark page headers. */
.btn-accent {
    color: var(--fc-on-primary);
    background-color: var(--fc-primary);
    border-color: var(--fc-primary);
}

    .btn-accent:hover, .btn-accent:focus, .btn-accent:active {
        color: var(--fc-on-primary-dark);
        background-color: var(--fc-primary-dark);
        border-color: var(--fc-primary-dark);
    }

.btn-outline-primary {
    color: var(--fc-slate);
    background-color: var(--fc-surface);
    border-color: var(--fc-border);
}

    .btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary.active {
        color: var(--fc-on-primary-dark);
        background-color: var(--fc-primary-dark);
        border-color: var(--fc-primary-dark);
    }

/* Outline button on a dark header. */
.btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

    .btn-outline-light:hover, .btn-outline-light:focus, .btn-outline-light:active {
        color: var(--fc-on-primary);
        background-color: var(--fc-primary);
        border-color: var(--fc-primary);
    }

.btn-outline-secondary {
    color: var(--fc-muted);
    background-color: var(--fc-surface);
    border-color: var(--fc-border-strong);
}

    .btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active {
        color: #fff;
        background-color: var(--fc-muted);
        border-color: var(--fc-muted);
    }

.btn-outline-danger {
    color: var(--fc-danger-text);
    background-color: var(--fc-surface);
    border-color: var(--fc-border-strong);
}

    .btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active {
        color: #fff;
        background-color: var(--fc-danger-text);
        border-color: var(--fc-danger-text);
    }

.btn-success {
    color: var(--fc-dark);
    background-color: var(--fc-success);
    border-color: var(--fc-success);
}

    .btn-success:hover, .btn-success:focus, .btn-success:active {
        color: var(--fc-dark);
        background-color: #1ec4a0;
        border-color: #1ec4a0;
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--fc-primary-ring);
}

/* ---------- Forms ---------- */
.form-label {
    font-family: var(--fc-font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fc-slate);
    margin-bottom: 0.4rem;
}

.form-control, .form-select, .input-group-text {
    color: var(--fc-slate);
    background-color: var(--fc-surface);
    border-color: var(--fc-border-strong);
    border-radius: 2px;
    min-height: 44px;
}

    .form-control:focus, .form-select:focus {
        color: var(--fc-slate);
        background-color: var(--fc-surface);
        border-color: var(--fc-primary-dark);
    }

    .form-control::placeholder {
        color: #8b8f96;
    }

/* File inputs: Bootstrap sizes the "Choose File" button for a 38px box; ours are 44px, so match the
   padding and the button's offsets to make it fill the box's full height. */
.form-control[type=file] {
    --fc-file-pad: calc((44px - 2px - 1.5rem) / 2); /* min-height less borders and one line of text */
    padding-top: var(--fc-file-pad);
    padding-bottom: var(--fc-file-pad);
}

    .form-control[type=file]::file-selector-button {
        padding: var(--fc-file-pad) 0.75rem;
        margin: calc(-1 * var(--fc-file-pad)) -0.75rem;
        margin-inline-end: 0.75rem;
        font-family: var(--fc-font-accent);
        font-size: 0.75rem;
        line-height: 1.5rem; /* same as the input's text, so the button stays full height */
        font-weight: 700;
        text-transform: uppercase;
        color: var(--fc-slate);
        background-color: var(--fc-surface-2);
        border-color: var(--fc-border-strong);
    }

    .form-control[type=file]:not(:disabled):not([readonly]):hover::file-selector-button {
        background-color: var(--fc-border-strong);
    }

    .form-control:disabled, .form-control[readonly], .form-select:disabled {
        background-color: var(--fc-border);
        color: var(--fc-muted);
    }

.form-floating > label {
    color: var(--fc-muted);
}

.form-check-input {
    border-color: #a9adb4;
}

    .form-check-input:checked {
        background-color: var(--fc-slate);
        border-color: var(--fc-slate);
    }

.darker-border-checkbox.form-check-input {
    border-color: #8a8e95;
}

/* ---------- Lists, tables, alerts, badges ---------- */
.list-group-item {
    color: var(--fc-text);
    background-color: var(--fc-surface);
    border-color: var(--fc-border);
}

.list-group-item-action:hover, .list-group-item-action:focus {
    color: var(--fc-slate);
    background-color: var(--fc-surface-2);
}

.list-group-item.active {
    color: var(--fc-on-primary);
    background-color: var(--fc-primary);
    border-color: var(--fc-primary);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-color: var(--fc-text);
    --bs-table-striped-bg: #f9f9f9;
    color: var(--fc-text);
    border-color: var(--fc-border);
    vertical-align: middle;
}

    .table > :not(caption) > * > * {
        padding: 0.85rem 0.75rem;
    }

    .table > thead {
        font-family: var(--fc-font-accent);
        font-size: 0.73rem;
        text-transform: uppercase;
        color: var(--fc-slate);
        background-color: var(--fc-surface-2);
    }

        .table > thead th {
            font-weight: 700;
        }

    .table > :not(:first-child) {
        border-top: 1px solid var(--fc-border);
    }

.alert {
    border-radius: 2px;
    border-left-width: 4px;
}

.alert-info {
    color: var(--fc-slate);
    background-color: var(--fc-primary-tint);
    border-color: var(--fc-primary-tint-border);
    border-left-color: var(--fc-primary-dark);
}

.alert-success {
    color: #0f5e4c;
    background-color: #e3faf4;
    border-color: #b5ecdf;
    border-left-color: var(--fc-success);
}

.alert-warning {
    color: #7a3d0c;
    background-color: #fff1e6;
    border-color: #ffd2b0;
    border-left-color: var(--fc-orange);
}

.alert-danger {
    color: #8c1d1d;
    background-color: #fdeaea;
    border-color: #f6c1c1;
    border-left-color: var(--fc-danger);
}

.badge {
    font-family: var(--fc-font-accent);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 2px;
    padding: 0.4em 0.65em;
}

/* text-bg-* arrived in Bootstrap 5.2; defined here so badges get color on 5.1. */
.text-bg-success {
    color: var(--fc-dark) !important;
    background-color: var(--fc-success) !important;
}

.text-bg-secondary {
    color: var(--fc-slate) !important;
    background-color: var(--fc-border) !important;
}

.text-bg-warning {
    color: var(--fc-on-primary) !important;
    background-color: var(--fc-primary) !important;
}


/* ---------- Alchemists card: white box, header with a yellow bar on the left ---------- */
.card {
    background-color: var(--fc-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    margin-bottom: 1.25rem;
}

.card__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 64px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--fc-border);
    overflow: hidden;
}

    /* Also the settings pages' first heading (.fc-manage below), which plays the card header. */
    .card__header::before, .fc-manage > .card__content > h3:first-child::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background-color: var(--fc-primary);
        border-top-left-radius: calc(var(--fc-radius) - 1px);
    }

    .card__header > h2, .card__header > h3, .card__header > h4 {
        font-size: 1.05rem;
        margin: 0;
    }


/* A row of filter fields under a card header. */
.card__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--fc-border);
}

.card__filter {
    display: flex;
    flex-direction: column;
    flex: 1 1 150px;
    min-width: 0;
}

    .card__filter .form-label {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--fc-muted);
        margin-bottom: 0.25rem;
    }

.card__filter--wide {
    flex: 2 1 200px;
}

.card__filter--actions {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 0.5rem;
}

.card__count {
    color: var(--fc-muted);
    font-weight: 600;
}

.card__content {
    padding: 1.5rem;
}

/* Collapsible card: <CardToggle /> in the header, toggled by app.js. */
.card--collapsible > .card__header {
    cursor: pointer;
}

    .card--collapsible > .card__header > h2, .card--collapsible > .card__header > h3 {
        margin-right: auto;
    }

.card__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}

    .card__toggle:not(.card__toggle--filters) {
        width: 2rem;
        height: 2rem;
        padding: 0;
        border: 0;
        border-radius: var(--fc-radius);
        background: transparent;
        color: var(--fc-muted);
    }

        .card__toggle:not(.card__toggle--filters):hover {
            color: var(--fc-dark);
        }

    .card__toggle::after {
        content: "";
        width: 0.5rem;
        height: 0.5rem;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.15s ease;
    }

    .card__toggle--filters::after {
        width: 0.4rem;
        height: 0.4rem;
    }

.card--collapsed > .card__header > .card__toggle:not(.card__toggle--filters)::after,
.card--collapsible:not(.card--filters-open) > .card__header > .card__toggle--filters::after {
    transform: translateX(-2px) rotate(-45deg);
}

.card--collapsed > .card__header {
    border-bottom: 0;
}

.card--collapsed > :not(.card__header),
.card--collapsed > .card__header > .card__toggle--filters,
.card--collapsible:not(.card--filters-open) > .card__filters {
    display: none;
}

/* A table or list that runs edge to edge inside the card. */
.card--flush > .card__content {
    padding: 0;
}

    .card--flush > .card__content > .table {
        margin-bottom: 0;
    }

    .card--flush > .card__content > .list-group {
        border-radius: 0;
    }

        .card--flush > .card__content > .list-group > .list-group-item {
            border-left: 0;
            border-right: 0;
            padding: 0.9rem 1.5rem;
        }

            .card--flush > .card__content > .list-group > .list-group-item:first-child {
                border-top: 0;
            }

            .card--flush > .card__content > .list-group > .list-group-item:last-child {
                border-bottom: 0;
            }

    .card--flush > .card__content > .card__empty {
        padding: 1.5rem;
        margin: 0;
    }

/* ---------- Page heading: dark band like the template's player/team headers ---------- */
.fc-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--fc-dark);
    background-image: var(--fc-dark-texture);
    color: #fff;
    border-radius: var(--fc-radius);
    margin-bottom: 1.5rem;
}

.fc-hero__body {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2rem;
    padding: 2rem 2rem 1.75rem;
}

.fc-hero__media {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--fc-radius);
    background-color: var(--fc-dark-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: var(--fc-font-accent);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--fc-primary-on-dark);
    text-transform: uppercase;
}

    .fc-hero__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.fc-hero__media--contain img {
    object-fit: contain;
    padding: 0.75rem;
}

.fc-hero__text {
    flex: 1 1 280px;
    min-width: 0;
}

.fc-hero__eyebrow {
    font-family: var(--fc-font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fc-primary-on-dark);
    margin-bottom: 0.4rem;
}

.fc-hero__title {
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1;
    margin: 0;
    overflow-wrap: anywhere;
}

/* Two-line name: small first line, big yellow second line (player-info__name). */
.fc-hero__title-small {
    display: block;
    font-size: 0.5em;
    line-height: 1.1;
    margin-bottom: 0.15em;
}

.fc-hero__highlight {
    color: var(--fc-primary-on-dark);
}

    a.fc-hero__highlight:hover {
        color: var(--fc-primary-on-dark);
        text-decoration-color: currentColor;
    }

.fc-hero__meta {
    margin-top: 0.6rem;
    color: var(--fc-on-dark-muted);
    font-size: 1rem;
}

.fc-hero__number {
    font-family: var(--fc-font-accent);
    font-weight: 800;
    font-size: clamp(3.5rem, 9vw, 6rem);
    line-height: 0.85;
    color: var(--fc-primary-on-dark);
    letter-spacing: -0.04em;
}

.fc-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-self: center;
}

/* Home page: taller band with a bigger title. */
.fc-hero--home .fc-hero__body {
    padding-top: 3.5rem;
    padding-bottom: 3rem;
}

.fc-hero--home .fc-hero__title {
    font-size: clamp(2.4rem, 7vw, 4.5rem);
}

.fc-hero__lead {
    font-size: 1.15rem;
    max-width: 560px;
    margin-bottom: 0;
}

/* Stat strip along the bottom of the heading (player-info-details). */
.fc-hero__stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.18);
}

.fc-stat {
    padding: 1rem 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
}

    .fc-stat:last-child {
        border-right: none;
    }

.fc-stat__label {
    font-family: var(--fc-font-accent);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fc-on-dark-muted);
}

.fc-stat__value {
    font-family: var(--fc-font-accent);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.2rem;
    overflow-wrap: anywhere;
}

/* ---------- Roster: two-line name (team-roster) ---------- */
.fc-name {
    display: inline-block;
    font-family: var(--fc-font-accent);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.15;
}

.fc-name__first {
    display: block;
    font-size: 0.72rem;
    color: var(--fc-muted);
}

.fc-name__last {
    display: block;
    font-size: 0.95rem;
    color: var(--fc-slate);
}

/* Phone / email links (ContactLinks), wrapping onto separate lines on narrow screens. */
.fc-contact {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.75rem;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

/* Labeled phone / email rows in a card (player profile). */
.fc-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
}

.fc-contact-list__row dt {
    font-family: var(--fc-font-accent);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fc-muted);
}

.fc-contact-list__row dd {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

/* Player photo on a roster, initials when there's no photo. */
.fc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--fc-dark);
    color: var(--fc-primary-on-dark);
    font-family: var(--fc-font-accent);
    font-size: 0.8rem;
    font-weight: 800;
    overflow: hidden;
}

    .fc-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.fc-roster-photo {
    width: 1%; /* shrink to the photo */
}

/* The signed-in player's own row on a roster ("My Team"). */
.table tr.fc-row--me {
    background-color: var(--fc-primary-tint);
}

/* Date block used in tournament lists (event date "tile"). */
.fc-date {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--fc-radius);
    background-color: var(--fc-surface-2);
    border: 1px solid var(--fc-border);
    font-family: var(--fc-font-accent);
    text-transform: uppercase;
    line-height: 1;
    flex-shrink: 0;
}

.fc-date__month {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--fc-muted);
}

.fc-date__day {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--fc-slate);
    margin-top: 2px;
}

.fc-date--past {
    opacity: 0.6;
}

/* Large month/day shown in a tournament's page heading. */
.fc-date__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.fc-date__hero-month {
    font-size: 0.9rem;
    color: #fff;
    letter-spacing: 0.08em;
}

.fc-date__hero-day {
    font-size: 3rem;
    color: var(--fc-primary-on-dark);
    margin-top: 0.1em;
}

.fc-park-name {
    font-family: var(--fc-font-accent);
    font-size: 0.85rem;
    color: var(--fc-slate);
}

/* Ballpark names on tournament and league pages link to Google Maps. */
a.fc-park-name {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Google's place search box (BallparkPicker.razor) fills its column. */
.fc-place-search {
    display: block;
    width: 100%;
}

/* Small team logo tile, initials when there's no logo. */
.fc-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--fc-radius);
    background-color: var(--fc-dark);
    color: var(--fc-primary-on-dark);
    font-family: var(--fc-font-accent);
    font-size: 0.8rem;
    font-weight: 800;
    overflow: hidden;
}

    .fc-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background-color: #fff;
    }

/* Larger logo preview on the team edit form. */
.fc-logo--preview {
    width: 96px;
    height: 96px;
    font-size: 1.6rem;
}

/* "Are you sure?" dialog before removing something (ConfirmDialog). */
.fc-confirm {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: var(--fc-radius);
    background-color: var(--fc-surface);
    color: var(--fc-text);
}

    .fc-confirm::backdrop {
        background-color: rgba(0, 0, 0, 0.65);
    }

.fc-confirm__body {
    padding: 1.25rem 1.25rem 1rem;
}

.fc-confirm__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--fc-border);
}

/* Crop dialog for player photos and team logos (ImageCropper, Cropper.js). It never scrolls: the crop
   area shrinks to fit the screen so the buttons are always in view. */
.fc-cropper {
    width: min(760px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px); /* visible height on phones, where 100vh runs behind the toolbars */
    padding: 0;
    border: 0;
    border-radius: var(--fc-radius);
    overflow: hidden;
}

    .fc-cropper[open] {
        display: flex;
        flex-direction: column;
    }

    .fc-cropper::backdrop {
        background-color: rgba(0, 0, 0, 0.65);
    }

.fc-cropper__header {
    flex: none;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.fc-cropper__body {
    flex: 1 1 472px; /* 440px crop area plus padding, less on short screens */
    min-height: 140px;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.fc-cropper__stage {
    flex: 1 1 0; /* not sized by the image, so Cropper fits the image to the space */
    min-width: 0;
    min-height: 0;
    background-color: var(--fc-dark);
}

    .fc-cropper__stage img {
        display: block;
        max-width: 100%;
    }

.fc-cropper__side {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fc-cropper__preview {
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: var(--fc-radius);
    background-color: var(--fc-dark-2);
}

.fc-cropper__preview--logo {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.fc-cropper__footer {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.fc-cropper__tools, .fc-cropper__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

    .fc-cropper__tools .btn {
        min-width: 2.5rem;
        font-size: 1rem;
        line-height: 1.2;
    }

.fc-cropper__actions {
    margin-left: auto;
}

/* Link tiles (home "Get started"): bordered boxes that pick up a yellow edge on hover. */
.fc-tiles {
    display: grid;
    gap: 0.75rem;
}

.fc-tile {
    display: block;
    padding: 0.9rem 1rem 0.9rem 1.1rem;
    border: 1px solid var(--fc-border);
    border-left: 4px solid var(--fc-border);
    border-radius: var(--fc-radius);
    background-color: var(--fc-surface);
    font-weight: 400;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

    .fc-tile:hover, .fc-tile:focus {
        border-left-color: var(--fc-primary);
        background-color: var(--fc-surface-2);
        text-decoration: none;
    }

.fc-tile__title {
    display: block;
    font-family: var(--fc-font-accent);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fc-slate);
}

.fc-tile__text {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.95rem;
    color: var(--fc-muted);
}

.fc-row-link {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ---------- Login / register: a compact tile centered in the page ---------- */
/* The stage fills the space between the header and footer and centers the tile in it. */
main:has(.fc-auth-stage) {
    display: flex;
    flex-direction: column;
}

    main:has(.fc-auth-stage) > .content {
        flex: 1;
        display: flex;
    }

.fc-auth-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.fc-auth {
    width: 100%;
    max-width: 380px;
    background-color: var(--fc-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(30, 32, 36, 0.12);
}

.fc-auth--wide {
    max-width: 500px;
}

.fc-auth__header {
    padding: 1.25rem 1.5rem 1.1rem;
    background-color: var(--fc-dark);
    background-image: var(--fc-dark-texture);
    border-bottom: 4px solid var(--fc-primary);
}

    .fc-auth__header .fc-hero__eyebrow {
        font-size: 0.68rem;
        margin-bottom: 0.25rem;
    }

.fc-auth__title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.fc-auth__lead {
    color: var(--fc-on-dark-muted);
    font-size: 0.92rem;
    margin: 0.3rem 0 0;
}

.fc-auth__body {
    padding: 1.25rem 1.5rem 2rem;
}

    .fc-auth__body .form-label {
        margin-bottom: 0.3rem;
    }

    .fc-auth__body .form-control {
        min-height: 40px;
    }

.fc-auth__footer {
    padding: 0.8rem 1.5rem;
    background-color: var(--fc-surface-2);
    border-top: 1px solid var(--fc-border);
    text-align: center;
    font-size: 0.92rem;
    color: var(--fc-muted);
}

/* Code fields (2FA, recovery code): bigger, spaced digits. */
.fc-auth__code {
    font-family: var(--fc-font-accent);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
}

/* ---------- Account settings (Account/Shared/ManageLayout) ---------- */
/* Shorter heading band than the player and team pages. */
.fc-hero--compact .fc-hero__body {
    padding-top: 1.5rem;
    padding-bottom: 1.4rem;
}

.fc-hero--compact .fc-hero__title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

/* Settings menu: a card of links, the current one marked with the yellow bar. */
.fc-side-nav {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

    .fc-side-nav .nav-link {
        display: block;
        padding: 0.6rem 1.25rem;
        border-left: 4px solid transparent;
        font-family: var(--fc-font-accent);
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--fc-slate);
    }

        .fc-side-nav .nav-link:hover {
            background-color: var(--fc-surface-2);
            text-decoration: none;
        }

        .fc-side-nav .nav-link.active {
            border-left-color: var(--fc-primary);
            background-color: var(--fc-surface-2);
            color: var(--fc-dark);
        }

/* Each settings page starts with an h3, shown as the panel's card header. */
.fc-manage > .card__content > h3:first-child {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 64px;
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--fc-border);
    font-size: 1.05rem;
}


.fc-manage h4 {
    font-size: 0.95rem;
    margin-top: 1.5rem;
}

.fc-manage .form-floating {
    max-width: 420px;
}

/* Recovery codes in a grid of tiles. */
.fc-recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    max-width: 480px;
}

    .fc-recovery-codes code {
        display: block;
        padding: 0.5rem;
        text-align: center;
        font-size: 1rem;
        color: var(--fc-slate);
        background-color: var(--fc-surface-2);
        border: 1px solid var(--fc-border);
        border-radius: var(--fc-radius);
    }

.fc-qr {
    display: block;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background-color: #fff;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
}

/* Role picker: each role is a clickable box that turns yellow-edged when checked. */
.fc-roles {
    border: 0;
    padding: 0;
    min-width: 0;
}

    .fc-roles > legend {
        float: none;
        width: auto;
        margin-bottom: 0.6rem;
    }

.fc-roles__note {
    font-family: var(--fc-font-base);
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: none;
    color: var(--fc-muted);
}

.fc-roles__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
}

.fc-role {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--fc-border-strong);
    border-left: 4px solid var(--fc-border-strong);
    border-radius: var(--fc-radius);
    background-color: var(--fc-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

    .fc-role:hover {
        background-color: var(--fc-surface-2);
    }

    .fc-role .form-check-input {
        flex-shrink: 0;
        margin-top: 0.15rem;
    }

    .fc-role:has(.form-check-input:checked) {
        border-color: var(--fc-primary-dark);
        border-left-color: var(--fc-primary);
        background-color: var(--fc-primary-tint);
    }

.fc-role__name {
    display: block;
    font-family: var(--fc-font-accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fc-slate);
}

.fc-role__text {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--fc-muted);
}

/* Small name-only role tiles on the register card, one per row. */
.fc-auth .fc-roles__grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.fc-auth .fc-role {
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
}

    .fc-auth .fc-role .form-check-input {
        margin-top: 0;
    }

.fc-auth .fc-role__name {
    font-size: 0.72rem;
}

/* Team color picker (EditTeam): swatch radios in two groups. The radio itself is visually hidden but
   still takes focus, so the swatch shows the focus ring and checked state. */
.fc-colors {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

    .fc-colors > legend {
        float: none;
        width: auto;
        margin-bottom: 0.3rem;
    }

.fc-colors__group {
    font-size: 0.85rem;
    color: var(--fc-muted);
    margin: 0.6rem 0 0.4rem;
}

.fc-colors__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 0.4rem;
}

.fc-color {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    margin: 0;
    padding: 0.35rem 0.6rem 0.35rem 0.4rem;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    background-color: var(--fc-surface);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.2;
    color: var(--fc-text);
}

    .fc-color:hover {
        background-color: var(--fc-surface-2);
    }

    .fc-color input {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
        pointer-events: none;
    }

.fc-color__swatch {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.fc-color:has(input:checked) {
    border-color: var(--fc-slate);
    box-shadow: inset 0 0 0 1px var(--fc-slate);
    font-weight: 600;
    color: var(--fc-slate);
}

    .fc-color:has(input:checked) .fc-color__swatch {
        box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--fc-slate);
    }

.fc-color:has(input:focus-visible) {
    outline: 2px solid var(--fc-slate);
    outline-offset: 2px;
}

/* Theme Color card on My Profile (ThemeOption): the same swatches, with room for team names. */
.fc-colors__grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ---------- Layout & mobile ---------- */
.content {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

h1:focus {
    outline: none;
}

/* Rows with a label on one side and actions on the other wrap on narrow screens
   instead of squeezing the text. */
.list-group-item.d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    h1, .h1 {
        font-size: 1.6rem;
    }

    h2, .h2 {
        font-size: 1.3rem;
    }

    .fc-hero__body {
        padding: 1.5rem 1.25rem;
    }

    .fc-hero__media {
        width: 88px;
        height: 88px;
        font-size: 2rem;
    }

    .fc-stat {
        padding: 0.85rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .card__header, .card__content {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .fc-auth__header, .fc-auth__body, .fc-auth__footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .fc-manage > .card__content > h3:first-child {
        margin-left: -1.1rem;
        margin-right: -1.1rem;
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    /* Bigger tap targets for the small buttons used in list rows. */
    .btn-sm {
        padding: 0.6rem 0.9rem;
    }

    /* Full-width stacked buttons are easier to hit than side-by-side ones. */
    .form-actions {
        flex-direction: column;
    }

        .form-actions > .btn {
            width: 100%;
        }

    /* Crop dialog fills the visible screen: buttons pinned to the bottom, crop area takes the rest,
       preview beside the hint below it. */
    .fc-cropper {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }

    .fc-cropper__body {
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .fc-cropper__side {
        flex: none;
        flex-direction: row;
        align-items: center;
    }

    .fc-cropper__preview {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
    }

    .fc-cropper__tools .btn-sm {
        padding: 0.4rem 0.7rem;
    }

    /* Tables marked .table-stack turn each row into a card on phones.
       Cells show their data-label as a heading; the .stack-title cell becomes the card title. */
    .table-stack thead {
        display: none;
    }

    .table-stack, .table-stack tbody {
        display: block;
    }

        .table-stack tr {
            display: flex;
            flex-direction: column;
            background-color: var(--fc-surface);
            border: 1px solid var(--fc-border);
            border-left: 4px solid var(--fc-primary);
            border-radius: var(--fc-radius);
            margin-bottom: 0.75rem;
            padding: 0.5rem 0.85rem;
        }

        .card--flush .table-stack {
            padding: 0.75rem;
        }

        .table-stack > :not(:first-child) {
            border-top: none;
        }

        .table-stack td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            border: none;
            padding: 0.3rem 0 !important;
            text-align: right;
        }

            .table-stack td[data-label]::before {
                content: attr(data-label);
                font-family: var(--fc-font-accent);
                color: var(--fc-slate);
                font-size: 0.7rem;
                font-weight: 700;
                text-transform: uppercase;
                text-align: left;
                flex-shrink: 0;
            }

            .table-stack td.stack-title {
                order: -1;
                font-size: 1.05rem;
                font-weight: 600;
                text-align: left;
                justify-content: flex-start;
                padding-bottom: 0.5rem !important;
                margin-bottom: 0.2rem;
                border-bottom: 1px solid var(--fc-border);
            }

            .table-stack td:empty {
                display: none;
            }

            .table-stack td.stack-actions {
                justify-content: flex-end;
            }

            /* Roster photo leads the card, above the name. */
            .table-stack td.fc-roster-photo {
                order: -2;
                width: auto;
            }
}

/* ---------- Validation & errors ---------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--fc-success);
}

.invalid {
    outline: 1px solid var(--fc-danger);
}

.validation-message {
    color: var(--fc-danger-text);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* ---------- Privacy Policy, Terms of Use, Contact (Components/Pages/Legal) ---------- */
/* Long reading pages: a heading band, then the text in a card at a comfortable line length,
   each section heading marked with the yellow bar. */
.fc-legal {
    max-width: 52rem;
    margin: 0 auto;
}

.fc-legal__text {
    padding: 2rem 2.25rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

    .fc-legal__text > :last-child {
        margin-bottom: 0;
    }

    .fc-legal__text h2 {
        margin-top: 2rem;
        padding-left: 0.75rem;
        border-left: 4px solid var(--fc-primary);
        font-size: 1.05rem;
        line-height: 1.5;
    }

    .fc-legal__text li {
        margin-bottom: 0.35rem;
    }

@media (max-width: 575.98px) {
    .fc-legal__text {
        padding: 1.25rem 1.1rem;
        font-size: 1rem;
    }
}

/* ---------- Report link at the bottom of player, team, tournament and league pages (ReportButton) ---------- */
.fc-report {
    margin-top: 1.5rem;
    text-align: right;
}

.fc-report__link {
    color: var(--fc-muted);
    text-decoration: none;
}

    .fc-report__link:hover,
    .fc-report__link:focus {
        color: var(--fc-danger-text);
    }

    .fc-report__link svg {
        vertical-align: -2px;
    }

.fc-report__form {
    max-width: 28rem;
    margin-left: auto;
    text-align: left;
}

.fc-report__done {
    color: var(--fc-muted);
}
