.bmx-competition-frontend {
    border: 1px solid #ddd;
    padding: 16px;
    margin: 16px 0;
    border-radius: 6px;
    background: #fafafa;
    font-size: 14px;
}

/* En-tête global */

.bmx-front-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bmx-front-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.bmx-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eee;
    font-size: 12px;
}

.bmx-badge-main {
    background: #0073aa;
    color: #fff;
}

.bmx-badge-cat {
    background: #444;
    color: #fff;
}

.bmx-front-mode {
    margin-bottom: 8px;
}

.bmx-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #ccc;
    font-size: 12px;
    color: #555;
}

.bmx-pill-live {
    border-color: #d63638;
    color: #d63638;
}

/* Onglets */

.bmx-front-tabs {
    margin: 12px 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

.bmx-front-tab {
    display: inline-block;
    margin-right: 4px;
    margin-bottom: 4px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px 4px 0 0;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.bmx-front-tab:hover {
    background: #f0f0f0;
}

.bmx-front-tab-active {
    background: #fff;
    border-color: #ddd;
    border-bottom-color: #fff;
}

/* Vues */

.bmx-front-views {
    margin-top: 8px;
}

.bmx-front-view {
    padding-top: 4px;
}

/* Sections / blocs */

.bmx-front-section {
    margin-bottom: 18px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.bmx-front-section h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

.bmx-front-manche,
.bmx-front-round {
    margin-bottom: 12px;
}

.bmx-front-manche h4,
.bmx-front-round h4 {
    margin: 4px 0 6px;
    font-size: 14px;
    font-weight: 600;
}

.bmx-front-race h5 {
    margin: 4px 0;
    font-size: 13px;
    font-weight: 500;
}

/* Tables */

.bmx-front-table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 10px;
    font-size: 13px;
}

.bmx-front-table thead {
    background: #f2f2f2;
}

.bmx-front-table th,
.bmx-front-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    text-align: left;
}

.bmx-front-table th {
    font-weight: 600;
}

.bmx-front-table tbody tr:nth-child(odd) {
    background: #fbfbfb;
}

/* Classement général */

.bmx-front-ranking-cat {
    margin-bottom: 18px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.bmx-front-ranking-cat h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

/* Résumés / messages */

.bmx-front-cat-summary {
    margin-bottom: 10px;
}

.bmx-front-empty,
.bmx-front-error,
.bmx-front-no-finals {
    font-style: italic;
    color: #666;
}

/* Boutons */

.bmx-front-cat-controls {
    margin: 8px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bmx-front-toggle-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.bmx-front-toggle-btn:hover {
    background: #e9e9e9;
}

/* Onglets de phases (Manches / 1/8 / 1/4 / 1/2 / Finale) dans une catégorie */

.bmx-front-cat-phase-tabs {
    margin: 10px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bmx-front-cat-phase-tab {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.bmx-front-cat-phase-tab:hover {
    background: #e9e9e9;
}

.bmx-front-cat-phase-tab-active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.bmx-front-cat-phase-views {
    margin-top: 6px;
}

/* Wrapper de table scrollable (mobile-friendly) */
.bmx-front-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 4px 0 10px;
}

/* On force une largeur minimale pour éviter les tables compressées */
.bmx-front-table {
    width: 100%;
    min-width: 520px; /* ajuste si tu veux plus ou moins large */
    border-collapse: collapse;
    font-size: 13px;
}

/* Liste complète des pilotes (onglet "Tous les pilotes") */
.bmx-front-section-allriders {
    margin-bottom: 18px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.bmx-front-allriders-controls {
    margin: 6px 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.bmx-front-allriders-label {
    font-size: 12px;
    color: #555;
}

.bmx-front-allriders-sort {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.bmx-front-allriders-sort:hover {
    background: #e9e9e9;
}

.bmx-front-allriders-sort-active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}