/* ============================================================
   MY RACES PAGE
   Append this block to style.css.
   Mobile rules belong inside the existing @media (max-width: 768px)
   block at the bottom of style.css — see the mobile section below.
   ============================================================ */

/* ── Page header ────────────────────────────────────────────────────────── */

.my-races-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
    margin-bottom: 2rem;
}

.my-races-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.my-races-header .subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

/* ── Collapsible sections ────────────────────────────────────────────────── */

.my-races-section {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

/* Remove default browser marker */
.my-races-section > summary { list-style: none; }
.my-races-section > summary::-webkit-details-marker { display: none; }

/* Section summary bar — solid blue, matches old look */
.my-races-section__summary {
    background: var(--primary-light);   /* rgb(90,121,209) */
    color: white;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s ease;
}

.my-races-section__summary:hover {
    background: var(--primary-dark);
}

.my-races-section__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
}

.my-races-section__title svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.my-races-section__count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    flex-shrink: 0;
}

.my-races-section__chevron {
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.my-races-section[open] > .my-races-section__summary .my-races-section__chevron {
    transform: rotate(180deg);
}

.my-races-section__body {
    padding: 0;
}

/* ── Race table ──────────────────────────────────────────────────────────── */
/*
   9 columns: Race | Date | Terrain | Distance | Notes | Tags | Club | Status | (Remove)
   Proportions taken from old my-races-styles.css:
     3fr 1.2fr 1fr 1fr 0.6fr 2fr 1fr 0.6fr [0.6fr]
*/

.race-table {
    display: flex;
    flex-direction: column;
}

.race-table__head,
.race-table__row {
    display: grid;
    /* 8 columns — no remove button (past / notes sections) */
    grid-template-columns: 3fr 1.2fr 1fr 1fr 0.6fr 2fr 1fr 0.6fr;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    align-items: center;
}

/* Add the remove column for watchlist and entered sections */
.race-table--removable .race-table__head,
.race-table--removable .race-table__row {
    grid-template-columns: 3fr 1.2fr 1fr 1fr 0.6fr 2fr 1fr 0.6fr 0.6fr;
}

/* Header row */
.race-table__head {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.race-table__h {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.race-table__h--center { text-align: center; }

/* Data rows */
.race-table__row {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
    cursor: pointer;
}

.race-table__row:last-child { border-bottom: none; }

.race-table__row:hover { background: #f8f9fa; }

.race-table__c {
    font-size: 0.875rem;
    color: var(--text-dark);
    min-width: 0;
}

/* ── Race name ───────────────────────────────────────────────────────────── */

.td-race-name { }

.race-name-link {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.race-name-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Date ────────────────────────────────────────────────────────────────── */

.td-date {
    font-size: 0.875rem;
    color: var(--text-dark);
    white-space: nowrap;
}

/* ── Terrain pill ────────────────────────────────────────────────────────── */

.terrain-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.terrain-pill--fell    { background: rgba(220, 38,  38, 0.1); color: #b91c1c; }
.terrain-pill--road    { background: rgba( 37, 99, 235, 0.1); color: #1d4ed8; }
.terrain-pill--trail   { background: rgba( 16,185, 129, 0.1); color: #047857; }
.terrain-pill--mixed   { background: rgba(245,158,  11, 0.1); color: #b45309; }
.terrain-pill--unknown { background: var(--bg-light);         color: var(--text-light); }

/* ── Distance ────────────────────────────────────────────────────────────── */

.td-distance {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ── Notes — centred icon ────────────────────────────────────────────────── */

.td-notes {
    text-align: center;
}

.note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* ── Tags — small compact pills, colour from inline style ───────────────── */

.td-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* .race-tag background-color is set inline by PHP tagPills() */
.race-tag {
    display: inline-block;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.5;
}

/* ── Club counts ─────────────────────────────────────────────────────────── */

.td-club {
    font-size: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* .club-count colours from old styles — soft blue/green badges */
.club-count {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.125rem 0.4rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.club-count--watch {
    background: #E3F2FD;
    color: #1565C0;
}

.club-count--enter {
    background: #E8F5E9;
    color: #2E7D32;
}

/* ── Status / clash — centred ────────────────────────────────────────────── */

.td-clash {
    text-align: center;
    font-size: 1.125rem;
}

.clash-badge {
    cursor: default;
}

/* ── Remove button ───────────────────────────────────────────────────────── */

.td-actions {
    text-align: center;
}

.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.remove-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.empty-section {
    text-align: center;
    padding: 3.5rem 2rem;
    background: linear-gradient(135deg, rgba(37,99,235,0.03) 0%, rgba(16,185,129,0.03) 100%);
    margin: 1rem;
    border-radius: 12px;
    border: 2px dashed var(--border);
    transition: all 0.3s ease;
}

.empty-section:hover {
    border-color: var(--primary);
}

.empty-section__icon {
    margin: 0 auto 1.25rem;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(16,185,129,0.1));
    border-radius: 50%;
    color: var(--primary);
}

.empty-section__icon svg {
    width: 40px;
    height: 40px;
}

.empty-section__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-section__body {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

/* ── Misc ────────────────────────────────────────────────────────────────── */

.no-data {
    color: var(--border);
    font-size: 0.875rem;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Club profile header ─────────────────────────────────────────────────── */

.club-profile-header {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.club-header-inner {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.club-logo-wrap {
    width: 240px;
    height: 240px;
    margin-top: -0.25rem;
}

.club-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.club-header-info {
    flex: 1;
    min-width: 0;
}

.club-name-row {
    margin-bottom: 0.5rem;
}

.club-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    line-height: 1.2;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    flex-shrink: 0;
}

.club-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
}

.club-location svg {
    flex-shrink: 0;
    color: var(--text-light);
}

.club-description {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    max-width: 640px;
}

.club-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* ── Club status notices ─────────────────────────────────────────────────── */

.club-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.club-notice svg { flex-shrink: 0; margin-top: 0.125rem; }

.club-notice strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.club-notice p { margin: 0; font-size: 0.875rem; }

.club-notice--warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    color: #92400e;
}
.club-notice--warning svg { color: #f59e0b; }

.club-notice--success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    color: #065f46;
}
.club-notice--success svg { color: #10b981; }

.club-notice--info {
    background: rgba(37, 99, 235, 0.08);
    border-left: 4px solid var(--primary);
    color: #1e3a8a;
}
.club-notice--info svg { color: var(--primary); }

.club-notice--verified {
    background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(16,185,129,0.05));
    border-left: 4px solid #10b981;
    color: #065f46;
}
.club-notice--verified svg { color: #10b981; }

/* ── Summary stats cards ─────────────────────────────────────────────────── */

.club-stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* Stat cards can be <a> tags (my-races page) — reset link styles */
a.club-stats-bar__item {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.club-stats-bar__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.club-stats-bar__item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Coloured top accent bar */
.club-stats-bar__item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.club-stats-bar__item--watch::before { background: var(--primary); }
.club-stats-bar__item--enter::before { background: var(--secondary); }
.club-stats-bar__item--past::before  { background: var(--text-light); }
.club-stats-bar__item--next::before  { background: #f59e0b; }

.club-stats-bar__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.club-stats-bar__item--watch .club-stats-bar__icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}
.club-stats-bar__item--enter .club-stats-bar__icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}
.club-stats-bar__item--past .club-stats-bar__icon {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-light);
}
.club-stats-bar__item--next .club-stats-bar__icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.club-stats-bar__num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.375rem;
    letter-spacing: -0.5px;
}

.club-stats-bar__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1.3;
}

/* ── Race table — club variant ───────────────────────────────────────────── */
/*
   5 columns: Race | Date | Terrain | Distance | Members
   Scoped to .club-race-table — does not affect my-races layout.
*/

.club-race-table.race-table__head,
.club-race-table .race-table__head,
.club-race-table .race-table__row {
    grid-template-columns: 3fr 1.2fr 1fr 1fr 1fr;
}

/* Four-column variant — public club profile page */
.club-stats-bar--four {
    grid-template-columns: repeat(4, 1fr);
}

/* Tighter padding on four-column cards so all four fit on one row */
.club-stats-bar--four .club-stats-bar__item {
    padding: 1.25rem 1.1rem;
}

/* Racerli members card — purple accent bar + icon */
.club-stats-bar__item--members::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #7c3aed;
}
.club-stats-bar__item--members .club-stats-bar__icon {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

/* Member count badge — clickable pill */
.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    white-space: nowrap;
}

.member-badge:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
}

.member-badge--watch {
    background: #E3F2FD;
    color: #1565C0;
}

.member-badge--enter {
    background: #E8F5E9;
    color: #2E7D32;
}

/* Past races use the entered colour */
.member-badge:not(.member-badge--watch) {
    background: #E8F5E9;
    color: #2E7D32;
}

/* ── Members modal ───────────────────────────────────────────────────────── */

.members-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.members-modal[hidden] { display: none; }

.members-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.members-modal__box {
    position: relative;
    background: var(--bg-white);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.members-modal__box--wide { max-width: 560px; }

.members-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.members-modal__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
}

.members-modal__subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.members-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: var(--text-light);
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.members-modal__close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.members-modal__body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.members-modal__loading {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.members-modal__empty {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 0;
    font-size: 0.9375rem;
}

/* Member list items */
.members-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 700;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-username {
    font-weight: 500;
    color: var(--text-dark);
}

/* Form elements reused in claim modal */
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-error {
    padding: 0.875rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.form-success {
    padding: 0.875rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    color: #065f46;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .race-table__head,
    .race-table__row {
        grid-template-columns: 2.5fr 1.2fr 1fr 1fr 0.6fr 1.5fr 0.8fr 0.6fr;
    }
    .race-table--removable .race-table__head,
    .race-table--removable .race-table__row {
        grid-template-columns: 2.5fr 1.2fr 1fr 1fr 0.6fr 1.5fr 0.8fr 0.6fr 0.6fr;
    }
}

@media (max-width: 960px) {
    .race-table__head,
    .race-table__row {
        grid-template-columns: 2fr 1fr 0.9fr 0.9fr 0.5fr 1.4fr 0.75fr 0.5fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .race-table--removable .race-table__head,
    .race-table--removable .race-table__row {
        grid-template-columns: 2fr 1fr 0.9fr 0.9fr 0.5fr 1.4fr 0.75fr 0.5fr 0.5fr;
    }
    .race-table__h  { font-size: 0.6875rem; }
    .race-table__c  { font-size: 0.8125rem; }
    .race-name-link { font-size: 0.875rem; }
    .race-tag       { font-size: 0.6875rem; }
    .club-count     { font-size: 0.6875rem; }
}

/* ── MOBILE: stack as labelled cards ─────────────────────────────────────
   Merge these rules into the existing @media (max-width: 768px) block
   at the bottom of style.css
   ──────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

    .my-races-header h1 { font-size: 1.5rem; }

    /* Hide column headers */
    .race-table__head { display: none; }

    /* Each row becomes a labelled card */
    .race-table__row,
    .race-table--removable .race-table__row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 1rem;
        background: var(--bg-white);
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin: 0.5rem;
        cursor: pointer;
    }

    .race-table__c { font-size: 0.875rem; }

    /* Race name — bigger, prominent */
    .td-race-name {
        font-size: 1.0625rem;
        font-weight: 600;
        margin-bottom: 0.625rem;
    }

    .race-name-link {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: inherit;
    }

    /* Labelled rows — ::before adds the field name */
    .td-date,
    .td-terrain,
    .td-distance,
    .td-notes,
    .td-tags,
    .td-club,
    .td-clash {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .td-date::before    { content: 'Date:';     font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .td-terrain::before { content: 'Terrain:';  font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .td-distance::before{ content: 'Distance:'; font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .td-notes::before   { content: 'Notes:';    font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .td-tags::before    { content: 'Tags:';     font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .td-club::before    { content: 'Club:';     font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .td-clash::before   { content: 'Status:';   font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }

    /* Notes icon left-aligned on mobile */
    .td-notes { text-align: left; }

    /* Tags wrap naturally on mobile */
    .td-tags {
        flex-wrap: wrap;
        gap: 0.25rem;
        align-items: flex-start;
    }

    /* Remove button — right aligned at bottom */
    .td-actions {
        text-align: right;
        margin-top: 0.5rem;
        border-bottom: none;
    }

    /* Flatten terrain pill on mobile */
    .terrain-pill {
        background: none !important;
        color: var(--text-dark) !important;
        padding: 0;
        font-size: 0.875rem;
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0;
    }

    /* Empty state adjustments */
    .empty-section {
        padding: 2.5rem 1.5rem;
        margin: 0.5rem;
    }

    .empty-section__icon { width: 56px; height: 56px; }
    .empty-section__icon svg { width: 32px; height: 32px; }
    .empty-section__title { font-size: 1.125rem; }

    .my-races-section__summary { padding: 0.875rem 1rem; }
    .my-races-section__title   { font-size: 1rem; }
}


@media (max-width: 768px) {

    /* Club header stacks vertically */
    .club-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .club-logo-wrap {
        width: 88px;
        height: 88px;
    }

    .club-name { font-size: 1.5rem; }

    /* Stats cards — stay 3 columns, scale down */
    .club-stats-bar {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    /* Four-column variant — 2x2 grid on mobile */
    .club-stats-bar--four {
        grid-template-columns: repeat(2, 1fr);
    }

    .club-stats-bar__item {
        padding: 1.125rem 1.25rem;
    }

    .club-stats-bar__icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.75rem;
    }

    .club-stats-bar__num  { font-size: 1.75rem; }
    .club-stats-bar__label{ font-size: 0.75rem; }

    /* Club race table — card view on mobile */
    .club-race-table .race-table__head { display: none; }

    .club-race-table .race-table__row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 1rem;
        background: var(--bg-white);
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin: 0.5rem;
    }

    .club-race-table .td-race-name {
        font-size: 1.0625rem;
        font-weight: 600;
        margin-bottom: 0.625rem;
    }

    .club-race-table .td-date,
    .club-race-table .td-terrain,
    .club-race-table .td-distance,
    .club-race-table .td-members {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
    }

    .club-race-table .td-date::before     { content: 'Date:';     font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .club-race-table .td-terrain::before  { content: 'Terrain:';  font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .club-race-table .td-distance::before { content: 'Distance:'; font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }
    .club-race-table .td-members::before  { content: 'Members:';  font-weight: 600; color: var(--text-light); font-size: 0.8125rem; }

    .club-race-table .td-terrain .terrain-pill {
        background: none !important;
        color: var(--text-dark) !important;
        padding: 0;
        font-size: 0.875rem;
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0;
    }

    .members-modal__box { max-width: 100%; margin: 0; border-radius: 12px 12px 0 0; }
    .members-modal { align-items: flex-end; }
}

