/*
 * Tableau de bord e-sport [upc_esports] aux couleurs du blog : variables du thème (--ink, --accent, --yellow…),
 * titres Barlow Condensed (Tajawal en arabe), cartes blanches à angles droits, tableau à en-tête sombre.
 */
.upc-esports {
  --es-live: #e11d48;
  --es-win: #15803d;
  --es-loss: #dc2626;
  margin: 0 0 32px;
  min-height: 1100px; /* le module est rempli par le navigateur : place réservée pour que le pied de page ne saute pas */
  container-type: inline-size;
  font-family: var(--font-text);
}
.upc-esports *, .upc-esports *::before, .upc-esports *::after { box-sizing: border-box; }
.upc-esports button { font: inherit; cursor: pointer; }
.upc-esports-page { padding-bottom: 10px; }

.es-demo { margin: 0 0 18px; padding: 10px 14px; background: #fff7d1; border-inline-start: 4px solid var(--yellow); color: var(--text); font-size: 14px; }
.es-block { margin-bottom: 34px; }
.es-heading { margin-bottom: 12px; }
.es-dot { display: inline-block; width: 9px; height: 9px; margin-inline-end: 9px; border-radius: 50%; background: var(--es-live); vertical-align: .12em; animation: es-pulse 1.4s infinite; }

/* Onglets : comme les liens de rubrique du menu (Barlow, majuscules, aplat bleu quand actif). */
.es-tabs { display: flex; gap: 6px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.es-tabs::-webkit-scrollbar { display: none; }
.es-tab { flex: none; padding: 7px 14px 5px; border: 1px solid var(--line); background: #fff; color: var(--text); font-family: var(--font-title) !important; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; transition: background .15s, color .15s; }
.es-tab:hover { border-color: var(--accent); color: var(--accent); }
.es-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Cartes de match : carrousel sur mobile, grille dès que la place le permet. */
.es-matches { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 86%); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
@container (min-width: 620px) { .es-matches { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); overflow: visible; } }
/* Place réservée avant l'arrivée des données (évite que le classement saute vers le bas). */
.es-matches { min-height: 330px; }
@container (min-width: 620px) { .es-matches { min-height: 680px; } }
.es-table-wrap { min-height: 420px; }
.es-more { display: block; width: 100%; margin-top: 14px; padding: 11px 14px 9px; border: 0; background: var(--ink); color: #fff; font-family: var(--font-title); font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.es-more:hover { background: var(--accent); }
[dir="rtl"] .es-more { text-transform: none; letter-spacing: 0; }
.es-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0 0 14px; background: #fff; border-top: 4px solid var(--ink); }
.es-card.is-live { border-top-color: var(--es-live); }
.es-card > * { margin-inline: 14px; }
.es-card > .es-card__top { margin: 0; padding-inline-end: 14px; border-bottom: 1px solid var(--line); }
.es-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Étiquette du jeu : même style que les étiquettes de rubrique (.upc-label). */
.es-game { display: inline-block; padding: 5px 9px 3px; background: var(--yellow); color: var(--ink); font-family: var(--font-title); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.es-live { display: inline-flex; align-items: center; gap: 6px; color: var(--es-live); font-family: var(--font-title); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.es-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--es-live); animation: es-blink 1.2s infinite; }
.es-time { color: var(--text-soft); font-family: var(--font-title); font-size: 16px; font-weight: 700; }
.es-tournament { margin-top: 2px; margin-bottom: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.es-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.es-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.es-team__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-family: var(--font-title); font-size: 19px; font-weight: 700; line-height: 1.1; }
.es-logo { display: block; width: 46px; height: 46px; padding: 5px; object-fit: contain; background: var(--bg); }
.es-logo--txt { display: inline-flex; align-items: center; justify-content: center; background: var(--ink-2); color: #fff; font-family: var(--font-title); font-size: 15px; font-weight: 700; }
.es-score { display: inline-flex; align-items: center; color: var(--ink); font-family: var(--font-title); font-size: 36px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.es-score b { font-weight: 700; }
.es-score i { margin: 0 7px; color: var(--muted); font-style: normal; }
.es-vs { color: var(--muted); font-family: var(--font-title); font-size: 20px; font-weight: 700; }

/* Pronostic : bleu Ultra PC contre jaune, comme le logo. */
.es-pred__nums { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-title); font-size: 18px; font-weight: 700; }
.es-pred__nums span:first-child { color: var(--accent); }
.es-pred__nums span:last-child { color: #a16207; }
.es-pred__label { padding: 0 6px; color: var(--muted); font-family: var(--font-text); font-size: 11.5px; font-weight: 500; text-align: center; }
.es-bar { display: flex; height: 8px; margin-top: 4px; background: var(--line); }
.es-bar__a { background: var(--accent); transition: width .4s; }
.es-bar__b { background: var(--yellow); transition: width .4s; }
.es-votes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.es-votes__q { flex: 1 1 100%; color: var(--text-soft); font-size: 12.5px; }
.es-vote { flex: 1; padding: 8px 6px 6px; border: 1px solid var(--line); background: #fff; color: var(--text); font-family: var(--font-title); font-size: 16px; font-weight: 700; text-transform: uppercase; line-height: 1.1; transition: .15s; }
.es-vote:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.es-vote:disabled { opacity: .5; cursor: default; }
.es-vote.is-mine { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; }
.es-watch { align-self: flex-start; color: var(--accent); font-size: 13px; font-weight: 700; }
.es-watch:hover { color: var(--accent-dark); }
.es-updated, .es-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.es-empty { margin: 0; padding: 20px; background: #fff; color: var(--text-soft); }

/* Classement + tournois du moment (colonne latérale dès que la place le permet). */
.es-grid { display: grid; gap: 26px; }
.es-grid > *, .es-block { min-width: 0; }
@container (min-width: 900px) { .es-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.es-table-wrap { background: #fff; overflow-x: auto; }
.upc-esports .es-table { display: table; width: 100% !important; margin: 0; border-collapse: collapse; font-size: 15px; }
.upc-esports .es-table th { padding: 10px 14px; background: var(--ink) !important; color: #fff; font-family: var(--font-title); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-align: start; border: 0; }
.upc-esports .es-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); background: #fff; color: var(--text); white-space: nowrap; }
.upc-esports .es-table tbody tr:nth-child(even) td { background: #f6f7f9; }
.upc-esports .es-table tbody tr:hover td { background: #eaf1fd; }
.es-row-team { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 18px; font-weight: 700; }
.upc-esports .es-table .es-logo { width: 32px; height: 32px; padding: 3px; font-size: 12px; }
.es-rank { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--bg); color: var(--ink); font-family: var(--font-title); font-size: 16px; font-weight: 700; }
.is-top .es-rank { background: var(--yellow); }
.upc-esports .es-table .es-elo { color: var(--accent); font-family: var(--font-title); font-size: 18px; font-weight: 700; }
.upc-esports .es-table .es-w { color: var(--es-win); font-weight: 700; }
.upc-esports .es-table .es-l { color: var(--es-loss); font-weight: 700; }
@media (max-width: 520px) { .es-hide-sm { display: none; } }

/* Tournois : tuiles sombres, comme les « news stream » de l'accueil. */
.es-side .upc-box-title { margin-bottom: 14px; }
.upc-esports .es-tournaments { display: grid; gap: 8px; margin: 0 !important; padding: 0 !important; list-style: none; }
.es-tour { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0; padding: 12px; background: var(--ink-2); color: #fff; }
.es-tour strong { display: block; color: #fff; font-family: var(--font-title); font-size: 18px; font-weight: 700; line-height: 1.1; }
.es-tour span:not(.es-game) { display: block; margin-top: 3px; color: rgba(255, 255, 255, .65); font-size: 12.5px; }
.es-tier { padding: 4px 8px 2px; border: 1px solid var(--yellow); color: var(--yellow); font-family: var(--font-title); font-size: 15px; font-style: normal; font-weight: 700; }

.es-skeleton { height: 240px; background: linear-gradient(90deg, #fff 0%, #f1f3f6 50%, #fff 100%); background-size: 200% 100%; animation: es-shimmer 1.3s infinite; }

/* Arabe : pas de majuscules ni d'espacement des lettres (casse la liaison), comme dans rtl.css. */
[dir="rtl"] .es-tab, [dir="rtl"] .es-game, [dir="rtl"] .es-live, [dir="rtl"] .es-vote, [dir="rtl"] .upc-esports .es-table th { text-transform: none; letter-spacing: 0; }

@keyframes es-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .55); } 60% { box-shadow: 0 0 0 7px rgba(225, 29, 72, 0); } }
@keyframes es-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes es-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .es-dot, .es-live i, .es-skeleton { animation: none; } }
