/* Reset de base pour éviter les calculs de taille bizarres */
* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #1a1a2e;
  color: #e4e4e4;
  line-height: 1.2;
}

h1,
h2 {
  margin-top: 25px;
  text-align: center;
  color: #e4e4e4;
  margin-bottom: 20px;
}

h1 {
  font-size: 2.5em;
}
h2 {
  font-size: 2.2em;
  margin-top: 30px;
}

.table-container {
  display: flex;
  justify-content: center;
  margin: 50px auto 0;
  max-width: 1750px;
}

table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  background-color: #2a2a44;
  border-radius: 10px;
  overflow: hidden;
  table-layout: fixed; /* Garde les colonnes stables */
}

th,
td {
  border: 1px solid #4a4a6e;
  padding: 10px 15px;
  text-align: center;
  vertical-align: middle;
  font-size: 1.1em;
}

/* Hauteur fixe pour éviter les sauts de ligne, mais sans bandes vides */
td {
  height: 75px;
  background-color: #2f2e51;
}

th {
  background-color: #0f4c75;
  color: #ffffff;
  text-transform: uppercase;
  height: 50px;
}

.td.rank-cell div {
  margin: 0px;
}

.rank-cell img {
  width: 75px; /* On augmente la taille de base */
  height: 75px;
  object-fit: contain;

  transform: scale(1.8);

  margin: -10px;

  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
  display: block;
}

.rank-cell span {
  font-weight: bold;
  white-space: nowrap;
}

/* --- BADGE INGAME --- */
@keyframes pulse-red {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.03);
  }
}

.ingame-badge {
  color: #ff4d4d;
  font-size: 0.7em;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  margin-top: 5px; /* Espace contrôlé sous le texte */
  background: rgba(255, 77, 77, 0.15);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 77, 77, 0.4);
  animation: pulse-red 1.5s infinite ease-in-out;
  white-space: nowrap;
}

.ingame-dot {
  margin-right: 5px;
  font-size: 1.2em;
  line-height: 1;
}

/* Nettoyage global des images dans le tableau */
td img {
  display: inline-block;
  vertical-align: middle;
}

/* Style du bouton DeepLoL */
.dpm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Espace entre l'icône et le texte */
  padding: 6px 12px;
  background-color: #1e293b; /* Bleu très foncé/gris */
  color: #f8fafc; /* Texte presque blanc */
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #334155;
  transition: all 0.2s ease-in-out;
}

/* Effet au survol */
.dpm-link:hover {
  background-color: #334155;
  border-color: #475569;
  color: #38bdf8; /* Le texte devient bleu clair */
  transform: translateY(-1px); /* Petit effet de soulèvement */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* On ajuste l'icône SVG à l'intérieur */
.dpm-link svg {
  opacity: 0.8;
}

.dpm-link:hover svg {
  opacity: 1;
}

#lpChart {
  min-height: 750px; /* Évite que le graphe ne s'écrase sur petit écran */
}

th[data-column] {
  /* Empêche la sélection du texte au clic */
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+ */

  /* Optionnel : change le curseur pour montrer que c'est cliquable */
  cursor: pointer;
}
#countdown-container {
  /* Fond harmonisé avec tes cartes de règlement */
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin: 0 auto 40px;
  max-width: 800px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.countdown-title {
  color: #94a3b8; /* Gris-bleu ardoise pour le titre */
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

#countdown {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.time-segment {
  display: flex;
  flex-direction: column;
  min-width: 80px;
}

.time-segment span {
  font-size: 3em;
  font-weight: 800;
  color: #38bdf8; /* Le bleu ciel de ta Team Blue */
  font-family: "Inter", "Segoe UI", sans-serif;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.3); /* Effet de lueur discrète */
}

.time-segment .label {
  font-size: 0.75em;
  color: #64748b; /* Couleur plus douce pour les labels (jours, heures...) */
  text-transform: uppercase;
  margin-top: 5px;
  font-weight: 600;
}
/* Style de base pour les lignes */
tr {
  transition: all 0.2s ease;
}

/* TEAM BLUE (Lueur bleue à gauche) */
.team-blue td:first-child {
  border-left: 5px solid #38bdf8;
}
.team-blue td {
  background-color: rgba(56, 189, 248, 0.02); /* Très léger voile bleu */
}

/* TEAM RED (Lueur rouge à gauche) */
.team-red td:first-child {
  border-left: 5px solid #ef4444;
}
.team-red td {
  background-color: rgba(239, 68, 68, 0.02); /* Très léger voile rouge */
}

/* Hover amélioré pour les teams */
.team-blue:hover td {
  background-color: rgba(56, 189, 248, 0.08);
}
.team-red:hover td {
  background-color: rgba(239, 68, 68, 0.08);
}

/* Badge de team (optionnel pour la colonne Pseudo) */
.team-tag {
  font-size: 0.6em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  font-weight: bold;
}
.tag-blue {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid #38bdf8;
}
.tag-red {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.rules-container {
  max-width: 1750px;
  margin: 60px auto;
  padding: 20px;
}

.rules-header {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.8em;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.rule-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 25px;
  backdrop-filter: blur(10px);
}

.rule-card h3 {
  margin-top: 0;
  color: #38bdf8;
  font-size: 1.1em;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.rule-card ul {
  padding-left: 20px;
  margin: 0;
}

.rule-card li {
  color: #94a3b8;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.rule-card strong {
  color: #f1f5f9;
}

.highlight-red {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}
.highlight-red h3 {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.highlight-blue {
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.05);
}

.special-rule {
  margin-top: 15px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-style: italic;
  font-size: 0.9em;
  color: #cbd5e1;
}

.rule-card.note {
  grid-column: 1 / -1;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.section-header-container {
  max-width: 1750px;
  margin: 80px auto 20px;
  padding: 0 20px;
}

.section-header-container .rules-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.8em;
  font-weight: 800;
  color: #f1f5f9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-wrapper,
.table-container {
  margin-top: 0 !important;
}

.sort-icon {
  display: inline-block;
  font-size: 0.75em;
  vertical-align: middle;
  margin-left: 5px;
  opacity: 0.6;
  transform: translateY(-4.5px);
}

.team-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  justify-content: center;
}

.filter-btn {
  background: #1e293b;
  border: none;
  color: #94a3b8;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-btn:hover {
  background: #334155;
  color: white;
}

.filter-btn.active {
  background: #0f172a;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.lane-badge {
  background: #333;
  color: #aaa;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.7em;
  text-transform: uppercase;
  margin-right: 5px;
}

.match-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid #444;
  transition: transform 0.2s;
}
.match-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
}
.match-date {
  font-size: 0.75em;
  color: #888;
  margin-bottom: 8px;
  display: block;
}
.match-players {
  font-size: 0.9em;
  margin-bottom: 10px;
  color: #eee;
}
.match-status {
  font-size: 0.85em;
  font-weight: bold;
  text-align: right;
}

/* Conteneur global */
#individualEvoLegend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Centre les badges */
  gap: 12px;
  margin-bottom: 25px;
  padding: 15px;
  max-width: 900px; /* Ajuste selon la largeur de ton site */
  margin-left: auto;
  margin-right: auto;
}

/* Chaque bloc contenant Checkbox + Label */
#individualEvoLegend > div {
  flex: 0 1 calc(18% - 10px); /* Force environ 5 éléments par ligne */
  min-width: 120px; /* Évite que ce soit trop petit sur mobile */
}

#individualEvoLegend input[type="checkbox"] {
  display: none;
}

/* Le bouton (Badge) */
#individualEvoLegend label {
  display: flex;
  align-items: center;
  justify-content: center; /* Centre le texte dans le badge */
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid transparent;
  border-radius: 8px; /* Un peu plus "carré" pour la DA LoL */
  color: #888;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%; /* Prend toute la place du div parent */
  box-sizing: border-box;
}

/* État coché */
#individualEvoLegend input[type="checkbox"]:checked + label {
  color: #fff;
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3), inset 0 0 5px currentColor;
}

/* État décoché */
#individualEvoLegend input[type="checkbox"]:not(:checked) + label {
  opacity: 0.3;
  filter: grayscale(1);
}

.champ-history-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 20px 0;
  width: 100%;
  justify-content: center;
  align-items: stretch; /* Force les cartes d'une même ligne à avoir la même hauteur */
}

.champ-history-item {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 10px;
  /* On fixe la largeur pour que toutes les cartes soient identiques */
  width: 230px;
  /* On fixe une hauteur minimum pour éviter les sauts de taille */
  min-height: 75px;
  border-left: 4px solid #c89b3c;
  box-sizing: border-box; /* Important pour que le padding ne change pas la taille */
  transition: all 0.2s ease;
}

.champ-history-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden; /* Empêche le texte de déborder */
  width: 100%;
}

.champ-history-img {
  width: 52px; /* Augmenté de 38px à 52px */
  height: 52px; /* Augmenté de 38px à 52px */
  border-radius: 4px;
  margin-right: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.champ-history-name,
.champ-history-master {
  white-space: nowrap; /* Force le texte sur une seule ligne */
  overflow: hidden; /* Coupe ce qui dépasse */
  text-overflow: ellipsis; /* Ajoute "..." si le nom est trop long */
  width: 100%;
}

.champ-history-stats {
  font-size: 13px; /* Augmenté */
  color: #a09b8c;
  margin-top: 2px;
}

.champ-history-master {
  font-size: 12px; /* Augmenté */
  color: #c89b3c;
  margin-top: 5px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Couleur dynamique selon le winrate (optionnel) */
.high-wr {
  border-left-color: #2ecc71;
}
.low-wr {
  border-left-color: #e74c3c;
}

/* Noms de classes uniques pour ne pas casser tes autres modals */
.modal-champ-unique {
  display: none;
  position: fixed;
  z-index: 9999; /* Très haut pour être au dessus de tout */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.modal-content-champ {
  background: #010a13; /* Couleur sombre Riot */
  margin: 10% auto;
  padding: 30px;
  border: 1px solid #c89b3c;
  width: 90%;
  max-width: 450px;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-modal-champ {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 30px;
  cursor: pointer;
  color: #c89b3c;
}

/* Personnalisation de la barre de défilement pour rester dans le style Riot */
#modalBody div::-webkit-scrollbar {
  width: 4px;
}
#modalBody div::-webkit-scrollbar-thumb {
  background: #c89b3c;
  border-radius: 10px;
}

.modal-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}
