/* OA CIF - Tables CSS (v4)
 * ✅ Avatars joueurs forcés à 50px MAX (UNIQUEMENT dans la colonne "Joueur")
 * ✅ Bannières d’équipe inchangées (elles gardent leur taille max 150px comme avant)
 *
 * Fichier : /oa_cif_tables.css
 */

/* =========================
   PARAMÈTRES À MODIFIER
   ========================= */
:root{
  --cif-avatar-size: 50px;     /* A MODIFIER : taille avatar joueur (max) */
  --cif-banner-maxw: 150px;    /* A MODIFIER : largeur max bannière équipe */
  --cif-banner-maxh: 38px;     /* A MODIFIER : hauteur max bannière équipe */
}

/* =========================
   LAYOUT GENERAL
   ========================= */
.cif-wrap{max-width:1100px;margin:10px auto 30px auto;padding:0 10px;}
.cif-headbar{background:#1c97d9;color:#fff;text-align:center;font-size:13px;font-weight:700;padding:8px 10px;border-radius:4px 4px 0 0;letter-spacing:.2px;}
.cif-subbar{background:#d8e7f3;padding:8px 10px;border-radius:0 0 4px 4px;border:1px solid #c8d8e7;border-top:0;text-align:left;margin-bottom:10px;}
.cif-backbtn.button{display:inline-block;padding:6px 10px;font-size:12px;text-decoration:none;}

.cif-panel{background:transparent;margin:12px 0 18px 0;}
.cif-h3{background:#1c97d9;color:#fff;padding:8px 10px;border-radius:4px 4px 0 0;margin:0;font-size:13px;font-weight:700;}

.cif-tablewrap{border:1px solid #c8d8e7;border-top:0;border-radius:0 0 4px 4px;overflow:auto;background:#d8e7f3;}

/* =========================
   TABLE
   ========================= */
.cif-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed; /* IMPORTANT anti-débordement */
}

.cif-table thead th{
  background:#d8e7f3;color:#0a4068;font-weight:700;font-size:11px;
  padding:10px 6px;border-bottom:1px solid #ffffff;text-align:center;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

.cif-table tbody td{
  background:#e7f0f8;color:#0a4068;font-size:11px;
  padding:10px 6px;text-align:center;border-bottom:1px solid #ffffff;
  overflow:hidden; /* IMPORTANT anti-débordement */
}

.cif-table thead th, .cif-table tbody td{border-right:1px solid #ffffff;}
.cif-table thead th:last-child, .cif-table tbody td:last-child{border-right:0;}

/* Largeurs colonnes */
.cif-col-rank{width:70px;}         /* A MODIFIER : largeur colonne position */
.cif-col-name{width:220px;}        /* A MODIFIER : colonne joueur */
.cif-col-team{width:170px;}        /* A MODIFIER : colonne équipe */
.cif-col-points{width:110px;}      /* A MODIFIER : colonne points */
.cif-total{font-weight:800;}

/* Contenu cellule "Nom" (équipe / joueur) */
.cif-name{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:4px;line-height:1.1;
}

/* =========================
   ✅ BANNIÈRES ÉQUIPE (NE PAS TOUCHER)
   ========================= */
.cif-team-banner img,
img.cif-team-banner-img{
  width:auto !important;                          /* garde proportions */
  height:auto !important;                         /* garde proportions */
  max-width: var(--cif-banner-maxw) !important;    /* A MODIFIER : largeur max bannière */
  max-height: var(--cif-banner-maxh) !important;   /* A MODIFIER : hauteur max bannière */
  display:block !important;
  margin:0 auto !important;
}

/* Empêche un débordement UNIQUEMENT pour les bannières : elles restent centrées dans leur colonne */
.cif-table td.cif-col-team img{
  max-width:100% !important;       /* ne dépasse pas la cellule équipe */
  height:auto !important;
}

/* =========================
   ✅ AVATARS JOUEURS (FORÇAGE 50px MAX)
   IMPORTANT : on cible UNIQUEMENT la colonne "Joueur"
   ========================= */

/* Cas 1 : ton wrapper .cif-avatar (si présent) */
.cif-table td.cif-col-name .cif-avatar img,
.cif-table td.cif-col-name img.cif-avatar-img{
  width: var(--cif-avatar-size) !important;     /* A MODIFIER : largeur avatar */
  height: var(--cif-avatar-size) !important;    /* A MODIFIER : hauteur avatar */
  max-width: var(--cif-avatar-size) !important;
  max-height: var(--cif-avatar-size) !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  display:block !important;
  margin:0 auto !important;
}

/* Cas 2 : markup phpBB (avatar / span.avatar / a.avatar) MAIS toujours dans la colonne Joueur */
.cif-table td.cif-col-name img.avatar,
.cif-table td.cif-col-name .avatar img,
.cif-table td.cif-col-name span.avatar img,
.cif-table td.cif-col-name a.avatar img{
  width: var(--cif-avatar-size) !important;     /* A MODIFIER */
  height: var(--cif-avatar-size) !important;    /* A MODIFIER */
  max-width: var(--cif-avatar-size) !important;
  max-height: var(--cif-avatar-size) !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  display:block !important;
  margin:0 auto !important;
}

/* Si phpBB met un conteneur avatar dimensionné, on le limite aussi (colonne Joueur uniquement) */
.cif-table td.cif-col-name .avatar,
.cif-table td.cif-col-name span.avatar,
.cif-table td.cif-col-name a.avatar{
  width: var(--cif-avatar-size) !important;     /* A MODIFIER */
  height: var(--cif-avatar-size) !important;    /* A MODIFIER */
  max-width: var(--cif-avatar-size) !important;
  max-height: var(--cif-avatar-size) !important;
  overflow:hidden !important;
  display:block !important;
  margin:0 auto !important;
}

/* =========================
   Bloc équipe sous un joueur (si utilisé)
   ========================= */
.cif-teamblock{
  margin-top:6px;padding-top:6px;width:100%;
  border-top:1px solid rgba(10,64,104,.12);
  display:flex;flex-direction:column;align-items:center;gap:3px;
}
.cif-teamname{font-size:10px;font-weight:800;}

/* Hover */
.cif-table tbody tr:hover td{background:#dfeaf4;}

/* Mobile */
@media (max-width: 700px){
  .cif-col-name{width:190px;}
  .cif-col-team{width:150px;}
  .cif-col-points{width:90px;}
  .cif-col-rank{width:60px;}
}
