﻿/* ==========================================================================
   Conteneur avec Scroller Horizontal
   ========================================================================== */
div.tas-panel-poule-combat {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 12px;
}

/* ==========================================================================
   Grille de la Poule (Séparation claire Entêtes / Grille)
   ========================================================================== */
table.tas-poule-combat {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0 auto; /* Centre le tableau si l'écran est grand */
}

    /* Les En-têtes (Flottants, sans bordure) */
    table.tas-poule-combat th {
        border: none;
        padding: 8px 0;
        text-align: center;
        vertical-align: bottom;
    }

.tas-poule-heading-text {
    font-weight: 700;
    font-size: 0.9em;
    color: var(--text-color);
}

/* Première colonne (Athlète) : Sans bordure */
table.tas-poule-combat td.tas-cell-athlete {
    border: none;
    padding: 4px 12px 4px 0;
    vertical-align: middle;
}

/* Cellules de la grille de combat (Carrés avec bordures sombres) */
table.tas-poule-combat td.tas-cell-score {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    height: 64px;
    border: 1px solid var(--border-color); /* Utilisation de la bordure du thème */
    padding: 0;
    vertical-align: middle;
    text-align: center;
    background-color: var(--card-bg);
}

    /* On masque les anciens tableaux internes s'il en reste */
    table.tas-poule-combat td.tas-cell-score table {
        display: none;
    }

/* ==========================================================================
   Design des Éléments Internes (Cartes, Badges, Scores)
   ========================================================================== */
/* Flexbox pour l'alignement de l'athlète et de son numéro */
.tas-athlete-container {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Pousse tout à droite */
    gap: 12px;
}

/* La carte du combattant (Design iOS propre et moderne) */
.tas-athlete-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-accent-border); /* La variable fait la bascule Bleu / Blanc atténué */
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    /* Uniformisation des tailles et alignement */
    width: 100%;
    white-space: nowrap; /* Interdit formellement tout retour à la ligne */
    box-sizing: border-box;
    text-align: right;
}

.tas-athlete-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9em;
    display: block;
    white-space: nowrap; /* Sécurité anti-retour à la ligne */
}

.tas-athlete-club {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
    white-space: nowrap; /* Sécurité anti-retour à la ligne */
}

/* Les pastilles grises (Numéros) */
.tas-position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--fj-blue); /* Bleu au lieu du gris */
    color: #FFFFFF;
    font-size: 0.85em;
    font-weight: bold;
    flex-shrink: 0; /* CORRECTION : Interdit formellement l'écrasement horizontal ! */
}

/* Nouveau : Badges rectangulaires pour les entêtes en mode colonne (ex: 1-2) */
.tas-position-badge-rect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px; /* Marges internes pour laisser respirer le texte */
    border-radius: 8px; /* Bords arrondis façon carte iOS */
    background-color: var(--fj-blue);
    color: #FFFFFF;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
}

/* Application du bleu alternatif en Mode Sombre pour les deux badges */
body.dark-mode .tas-position-badge,
body.dark-mode .tas-position-badge-rect {
    background-color: var(--fj-blue-alt);
}

.tas-cell-empty {
    /* Remplace rgba(118, 118, 128, 0.08) */
    background-color: color-mix(in srgb, var(--text-muted) 8%, transparent) !important;
}
    /* Le "X" du perdant */
.tas-poule-loser {
    font-size: 3em;
    color: var(--text-muted); /* Utilise directement le nuancier global */
    font-family: Arial, sans-serif;
    line-height: 1;
}

    /* Le score (Gagnant / Perdant) */
.tas-poule-winner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.tas-score-top {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--text-muted); /* Trait compatible mode clair/sombre */
    margin: 0 10px; /* Marge pour détacher le trait des bords verticaux */
    font-weight: 600;
    font-size: 0.95em;
}

.tas-score-bottom {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95em;
}

    /* ==========================================================================
   Badge "1ère catégorie" adaptatif (Mode Clair / Mode Sombre)
   ========================================================================== */
.tas-category-badge {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}