@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #08090d;
  --surface: #0f1118;
  --surface2: #151820;
  --border: #1e2133;
  --gold: #c89b3c;
  --gold2: #f0d060;
  --blue: #2a6dc2;
  --blue-light: #4a9fff;
  --red: #c53030;
  --red-light: #ff5555;
  --green: #2ecc71;
  --text: #e8e0d0;
  --muted: #5a6070;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  padding: 0;
}

/* ===== BACKGROUND EFFECTS ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(42, 109, 194, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 90% 90%, rgba(200, 155, 60, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='104'%3E%3Cpolygon points='30,2 58,17 58,47 30,62 2,47 2,17' fill='none' stroke='%231e2133' stroke-width='0.5'/%3E%3Cpolygon points='30,54 58,69 58,99 30,114 2,99 2,69' fill='none' stroke='%231e2133' stroke-width='0.5'/%3E%3Cpolygon points='0,28 28,13 28,43 0,58' fill='none' stroke='%231e2133' stroke-width='0.5'/%3E%3Cpolygon points='60,28 88,13 88,43 60,58' fill='none' stroke='%231e2133' stroke-width='0.5'/%3E%3C/svg%3E");
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

nav,
section,
header,
footer,
h1,
h2,
.modal-champ-unique,
#individualEvoLegend {
  position: relative;
  z-index: 1;
}

/* ===== NAV ===== */
.recap-nav {
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 0;
  background: rgba(8, 9, 13, 0.95);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.btn-nav {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 18px 32px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 26px);
  letter-spacing: 3px;
  transition: all 0.2s;
}

.btn-nav:hover {
  color: var(--text);
  background: rgba(200, 155, 60, 0.04);
}

.btn-nav.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ===== HEADINGS ===== */
h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 80px);
  text-align: center;
  letter-spacing: 4px;
  color: var(--text);
  padding: 48px 0 8px;
  line-height: 1;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
}

/* ===== RANKING PAGE ===== */
.ranking-page {
  background:
    radial-gradient(circle at top, rgba(42, 109, 194, 0.14), transparent 35%),
    linear-gradient(180deg, #06070a 0%, #090b11 100%);
}

.wrap {
  max-width: 90%;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.card {
  background: linear-gradient(180deg, rgba(16, 19, 28, 0.96), rgba(10, 12, 18, 0.98));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header {
  text-align: center;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(200, 155, 60, 0.35);
  background: rgba(200, 155, 60, 0.06);
}

.header h1 {
  padding: 0;
  margin: 0 0 10px;
  font-size: clamp(40px, 6vw, 72px);
}

.header p {
  max-width: 780px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.7;
}

.header-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

.status {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

.table-wrap {
  overflow-x: visible;
  /* était: auto */
  border: 1px solid var(--border);
  border-radius: 16px;
}

#rankingBody tr:hover td {
  background: rgba(200, 155, 60, 0.04);
}

.player-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--text);
}

.player-riot {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.rank-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 45px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  line-height: 1;
}

.rank-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 6px rgba(200, 155, 60, 0.25));
}

.role-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(200, 155, 60, 0.25));
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.35);
  background: rgba(200, 155, 60, 0.08);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.history-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  /* était: wrap */
  white-space: nowrap;
}

.history-cell {
  min-width: 220px;
  white-space: nowrap;
}

.history-chip {
  width: 20px;
  /* un peu plus petit pour tenir sur 1 ligne */
  height: 20px;
  flex-shrink: 0;
  /* empêche les chips de se compresser/wrapper */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  border: 1px solid transparent;
}

.history-win {
  color: #dff7e8;
  background: rgba(46, 204, 113, 0.16);
  border-color: rgba(46, 204, 113, 0.35);
}

.history-loss {
  color: #ffd7d7;
  background: rgba(255, 85, 85, 0.16);
  border-color: rgba(255, 85, 85, 0.35);
}

.history-more {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.good {
  color: var(--green);
}

.bad {
  color: var(--red-light);
}

.muted {
  color: var(--muted);
}

.empty {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  table-layout: auto;
}

th,
td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: center;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 0.95em;
}

td {
  height: 75px;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s;
  white-space: nowrap;
  /* ajouté */
}

th {
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  height: 46px;
}

th[data-column] {
  user-select: none;
  cursor: pointer;
  color: var(--text);
}

th[data-column]:hover {
  color: var(--gold);
}

/* ===== TEAM ROWS ===== */

/* ===== RANK CELL ===== */
.rank-cell img {
  width: 75px;
  height: 75px;
  object-fit: contain;
  transform: scale(1.8);
  margin: -10px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.15));
  display: block;
}

.rank-cell span {
  font-weight: bold;
  white-space: nowrap;
}

.valorant-rank-cell {
  gap: 10px;
}

.valorant-rank-cell .valorant-rank-icon {
  width: 40px;
  height: 40px;
  transform: none;
  margin: 0;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.18));
}

.valorant-rank-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text);
}

@media (max-width: 960px) {
  .valorant-rank-label {
    display: none;
  }
}

/* ===== INGAME BADGE ===== */

/* ===== DPM LINK ===== */
.dpm-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface2);
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.dpm-link:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 155, 60, 0.05);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2px;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.rule-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  transform: scaleY(0);
  transition: transform 0.25s;
}

.rule-card:hover::before {
  transform: scaleY(1);
}

.rule-card:hover {
  background: var(--surface2);
}

.rule-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.rule-card ul {
  padding-left: 18px;
  margin: 0;
}

.rule-card li {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.rule-card strong {
  color: var(--text);
}

.rule-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.highlight-red {
  border-color: rgba(255, 85, 85, 0.3);
  background: rgba(255, 85, 85, 0.03);
}

.highlight-red::before {
  background: var(--red-light);
}

.highlight-red h3 {
  color: var(--red-light);
  border-color: rgba(255, 85, 85, 0.2);
}

.highlight-blue {
  border-color: rgba(74, 159, 255, 0.3);
  background: rgba(74, 159, 255, 0.03);
}

.highlight-blue::before {
  background: var(--blue-light);
}

.special-rule {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid var(--gold);
  font-style: italic;
  font-size: 13px;
  color: var(--text);
}

/* ===== MODAL ===== */
.modal-champ-unique {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
}

.modal-content-champ {
  background: linear-gradient(180deg, rgba(18, 21, 31, 0.98), rgba(11, 13, 19, 0.99));
  padding: 28px 24px 24px;
  border: 1px solid rgba(200, 155, 60, 0.5);
  border-radius: 18px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

/* Variante large pour la modal "Détails de la Partie" (tableaux d'équipe) */
.modal-content-wide {
  max-width: 980px;
  width: min(96vw, 980px);
}

.modal-title-champ {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.modal-duration {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 20px;
}

.close-modal-champ {
  position: absolute;
  right: 20px;
  top: 12px;
  font-size: 28px;
  cursor: pointer;
  color: var(--gold);
  font-family: var(--font-mono);
  line-height: 1;
  transition: color 0.2s;
}

.close-modal-champ:hover {
  color: var(--gold2);
}

.match-result-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 18px;
  border-radius: 16px;
  margin: 6px 0 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(200, 155, 60, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.match-result-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 55%);
  pointer-events: none;
}

.match-result-hero.is-win {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.14), rgba(11, 13, 19, 0.96));
  border-color: rgba(46, 204, 113, 0.28);
}

.match-result-hero.is-loss {
  background: linear-gradient(135deg, rgba(255, 85, 85, 0.12), rgba(11, 13, 19, 0.96));
  border-color: rgba(255, 85, 85, 0.28);
}

.match-result-hero-icon {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  background: rgba(16, 18, 27, 0.9);
}

.match-result-hero-text {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.match-result-hero-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 6px;
}

.match-result-hero-champ {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0.94;
}

.match-result-hero-sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.match-result-hero-kda {
  position: relative;
  z-index: 1;
  text-align: right;
  min-width: 140px;
  white-space: nowrap;
  flex-shrink: 0;
}

.k-num {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--text);
  white-space: nowrap;
}

.k-ratio {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.match-result-hero-score {
  position: relative;
  z-index: 1;
  text-align: center;
  min-width: 90px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 2px;
  color: var(--text);
  padding: 0 6px;
  border-left: 1px solid rgba(200, 155, 60, 0.2);
  border-right: 1px solid rgba(200, 155, 60, 0.2);
}

.match-result-hero.is-win .match-result-hero-score {
  color: var(--green);
}

.match-result-hero.is-loss .match-result-hero-score {
  color: var(--red-light);
}

@media (max-width: 640px) {
  .match-result-hero {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .match-result-hero-score {
    border-left: none;
    border-right: none;
    padding: 4px 0;
  }

  .match-result-hero-kda {
    width: 100%;
    text-align: center;
  }
}

/* ===== MODAL — TABLEAUX D'ÉQUIPE (Détails de la partie) ===== */
.team-table-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}

.team-table-card:last-child {
  margin-bottom: 0;
}

.team-table-win {
  border-left-color: var(--green);
}

.team-table-loss {
  border-left-color: var(--red-light);
}

.team-table-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-table-win .team-table-header {
  background: rgba(46, 204, 113, 0.08);
}

.team-table-loss .team-table-header {
  background: rgba(255, 85, 85, 0.08);
}

.team-table-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
}

.team-table-win .team-table-title {
  color: var(--green);
}

.team-table-loss .team-table-title {
  color: var(--red-light);
}

.team-table-result {
  font-weight: 400;
  opacity: 0.75;
}

.team-table-score {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.team-table-win .team-table-score {
  color: var(--green);
}

.team-table-loss .team-table-score {
  color: var(--red-light);
}

.team-objectives {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(200, 155, 60, 0.2);
}

.objective-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(200, 155, 60, 0.18);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text);
}

.objective-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  background: rgba(200, 155, 60, 0.08);
  color: var(--text);
}

.objective-turret .objective-icon { background: rgba(74, 159, 255, 0.14); color: var(--blue-light); }
.objective-turret-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  display: inline-block;
  vertical-align: middle;
}
.objective-dragon .objective-icon { background: rgba(46, 204, 113, 0.14); color: var(--green); }
.objective-baron .objective-icon { background: rgba(240, 208, 96, 0.12); color: var(--gold2); }

.team-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-body);
  color: var(--text);
}

.team-table thead {
  background: rgba(200, 155, 60, 0.06);
}

.team-table th {
  padding: 8px 10px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.team-table th:not(:first-child) {
  text-align: center;
}

.team-table th:nth-child(1),
.team-table td:nth-child(1) {
  width: 24%;
}

.team-table th:nth-child(2),
.team-table td:nth-child(2) {
  width: 14%;
}

.team-table th:nth-child(3),
.team-table td:nth-child(3) {
  width: 18%;
}

.team-table th:nth-child(4),
.team-table td:nth-child(4) {
  width: 8%;
}

.team-table th:nth-child(5),
.team-table td:nth-child(5) {
  width: 12%;
}

.team-table th:nth-child(6),
.team-table td:nth-child(6) {
  width: 14%;
}

.team-table th:nth-child(7),
.team-table td:nth-child(7) {
  width: 10%;
}

.team-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.team-table tr:last-child td {
  border-bottom: none;
}

.team-player-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}



.team-champ-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}

.team-player-info {
  display: flex;
  align-items: center;
  min-height: 34px;
  min-width: 0;
  flex: 1;
}

.team-player-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.team-player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.mvp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.55);
  background: rgba(200, 155, 60, 0.14);
  color: #f0d17f;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mvp-badge-team {
  border-color: rgba(113, 188, 255, 0.55);
  background: rgba(113, 188, 255, 0.14);
  color: #9fd4ff;
}

.team-player-champ {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-stat-cell {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
}

.team-rank-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.team-rank-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.16));
}

.team-gold-cell {
  color: var(--gold);
  font-weight: 600;
}

/* ===== #lpChart ===== */
#lpChart {
  min-height: 750px;
}

/* ===== INDIVIDUAL EVO LEGEND ===== */
#individualEvoLegend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

#individualEvoLegend>div {
  flex: 0 1 calc(18% - 8px);
  min-width: 120px;
}

#individualEvoLegend input[type="checkbox"] {
  display: none;
}

#individualEvoLegend label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  width: 100%;
}

#individualEvoLegend input[type="checkbox"]:checked+label {
  color: currentColor;
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

#individualEvoLegend input[type="checkbox"]:not(:checked)+label {
  opacity: 0.25;
  filter: grayscale(1);
}

/* ===== RECAP PAGE ===== */
.recap-page {
  background: var(--bg);
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* Recap hero */
.recap-hero {
  text-align: center;
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.recap-section {
  margin-top: 48px;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: -8px;
  margin-bottom: 24px;
}

/* Podium */
.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 2px;
  align-items: end;
  margin-top: 32px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.podium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.25s;
}

.podium-card:hover {
  background: var(--surface2);
}

.podium-first {
  order: 2;
  padding: 36px 16px;
  border-color: rgba(200, 155, 60, 0.5);
  background: rgba(200, 155, 60, 0.04);
}

.podium-second {
  order: 1;
}

.podium-third {
  order: 3;
}

.podium-medal {
  font-size: 2rem;
  line-height: 1;
}

.podium-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
}

.podium-name {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 2px;
  color: var(--text);
}

.podium-lp {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
}

.podium-games {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ===== SOLO RANKING LIST (rest of ranking after podium) ===== */
.solo-ranking-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-top: 24px;
}

.ranking-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.ranking-row:hover {
  background: var(--surface2);
}

.ranking-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  min-width: 28px;
}

.ranking-name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--text);
  flex-grow: 1;
}

.ranking-lp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}

.ranking-games {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .solo-ranking-list {
    grid-template-columns: 1fr;
  }
}

/* Team winner banner */
.team-winner-banner {
  margin-top: 24px;
}

.team-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.team-blue-win {
  border-color: rgba(74, 159, 255, 0.4);
  background: rgba(74, 159, 255, 0.04);
}

.team-red-win {
  border-color: rgba(255, 85, 85, 0.4);
  background: rgba(255, 85, 85, 0.04);
}

.team-banner-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.team-banner-name {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 3px;
}

.team-blue-win .team-banner-name {
  color: var(--blue-light);
}

.team-red-win .team-banner-name {
  color: var(--red-light);
}

.team-banner-score {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.score-blue {
  color: var(--blue-light);
}

.score-red {
  color: var(--red-light);
}

.score-sep {
  color: var(--muted);
  font-size: 11px;
}

/* Rules in recap */
.rules-recap .rules-grid {
  margin-top: 24px;
}

.players-section .section-title {
  justify-content: center;
}

.players-section .section-title::before {
  display: none;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: 4px;
  color: var(--text);
  margin-top: 60px;
  margin-bottom: 0;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-title::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.section-title i {
  color: var(--gold);
  font-size: 0.75em;
}

/* ===== GLOBAL STATS (index.html) ===== */
.global-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
  margin-top: 24px;
}

.global-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.global-stat-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s;
}

.global-stat-card:hover::before {
  transform: scaleX(1);
}

.global-stat-card:hover {
  background: var(--surface2);
}

.global-stat-card i {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
  margin-top: 6px;
  letter-spacing: 1px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-top: 24px;
}

.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.2s;
}

.record-card:hover {
  background: var(--surface2);
}

.record-badge {
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  padding: 5px 10px;
  flex-shrink: 0;
}

.rec-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.rec-name {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  letter-spacing: 1px;
  margin: 3px 0;
}

.rec-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}

.rec-desc {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.champ-recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
  margin-top: 24px;
}

.champ-card-premium {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 12px;
  transition: all 0.25s;
}

.champ-card-premium:hover {
  border-color: rgba(200, 155, 60, 0.4);
  background: var(--surface2);
  transform: translateX(6px);
}

.champ-image-container {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.champ-image-container img {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.3s;
}

.champ-card-premium:hover .champ-image-container img {
  transform: scale(1.1);
}

.history-agent-icon {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.history-agent-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.champ-details {
  display: flex;
  align-items: center;
  margin-left: 14px;
  flex-grow: 1;
}

.champ-rank {
  font-family: var(--font-display);
  font-size: 2rem;
  color: rgba(200, 155, 60, 0.15);
  margin-right: 12px;
}

.champ-text {
  display: flex;
  flex-direction: column;
}

.champ-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.champ-count {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.champ-count small {
  color: var(--muted);
  font-size: 9px;
}

.champ-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 2px 8px;
  z-index: 5;
  box-shadow: 0 0 12px rgba(200, 170, 110, 0.4);
}

/* ===== PLAYERS PAGE ===== */
.players-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px;
  margin-top: 32px;
}

/* Player detail */
.detail-container {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  margin-top: 24px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
  margin-bottom: 28px;
}

.player-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--bg);
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 10px;
}

.personal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px;
  margin-bottom: 32px;
}

.p-stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
}

.p-stat-card:hover {
  background: rgba(200, 155, 60, 0.04);
}

.p-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.p-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 2px;
  margin: 12px 0;
  color: var(--text);
}

.p-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

.btn-back {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 8px 18px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 28px;
  transition: 0.2s;
}

.btn-back:hover {
  background: var(--gold);
  color: var(--bg);
}

/* Rank progression */
.progression-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 28px;
  position: relative;
  overflow: hidden;
  margin: 0;
}

.progression-header {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.rank-display {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 20px;
}

.rank-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
}

.rank-badge-container {
  position: relative;
  width: 100px;
  height: 100px;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rank-emblem {
  width: 350px;
  height: 250px;
  max-width: none;
  position: absolute;
  z-index: 2;
  transform: translateY(-5px);
}

.rank-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--gold);
  filter: blur(40px);
  opacity: 0.12;
  border-radius: 50%;
}

.rank-info {
  text-align: center;
  margin-top: 14px;
}

.rank-status {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.rank-tier {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  letter-spacing: 2px;
}

.rank-separator {
  display: flex;
  align-items: center;
  color: var(--gold);
  font-size: 1.3rem;
}

.arrow-line {
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
  height: 550px;
  margin-bottom: 250px;
  /* On pousse plus fort vers le bas */
}

#lpChart {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
}

/* ===== FOOTER ===== */
.gold-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 60px 0 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ===== ANIMATIONS ===== */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

td img {
  display: inline-block;
  vertical-align: middle;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-container {
    padding: 0 20px 60px;
  }

  .podium-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }

  .podium-first,
  .podium-second,
  .podium-third {
    order: unset;
    padding: 24px 16px;
  }

  .records-grid {
    grid-template-columns: 1fr;
  }

  .profile-details-grid {
    grid-template-columns: 1fr !important;
  }

  .btn-nav {
    padding: 14px 20px;
    font-size: 16px;
  }
}

/* Conteneur du logo du champion dans l'historique */
.history-emblem-container {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.history-emblem-container:hover {
  transform: scale(1.2);
  z-index: 10;
}

/* Image du champion à l'intérieur */
.history-champ-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Contour VERT pour une WIN */
.history-win {
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

/* Contour ROUGE pour une LOSE */
.history-loss {
  border-color: var(--red-light);
  box-shadow: 0 0 8px rgba(255, 85, 85, 0.4);
}

.in-game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 9px;
  padding: 4px 8px 4px 7px;
  border: 1px solid rgba(83, 214, 142, 0.35);
  border-radius: 6px;
  background: linear-gradient(
    135deg,
    rgba(46, 155, 97, 0.22),
    rgba(46, 155, 97, 0.08)
  );
  box-shadow:
    inset 0 0 12px rgba(83, 214, 142, 0.06),
    0 0 10px rgba(46, 155, 97, 0.08);
  color: #69e6a0;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.in-game-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #69e6a0;
  box-shadow:
    0 0 5px rgba(105, 230, 160, 0.9),
    0 0 10px rgba(105, 230, 160, 0.45);
  animation: in-game-pulse 1.6s ease-in-out infinite;
}

.in-game-badge.ranked {
  color: #e85d5d;
  border-color: rgba(232, 93, 93, 0.4);
  background: linear-gradient(
    135deg,
    rgba(180, 45, 45, 0.24),
    rgba(180, 45, 45, 0.08)
  );
  box-shadow:
    inset 0 0 12px rgba(232, 93, 93, 0.06),
    0 0 10px rgba(180, 45, 45, 0.12);
}

.in-game-badge.ranked::before {
  background: #e85d5d;
  box-shadow:
    0 0 5px rgba(232, 93, 93, 0.9),
    0 0 10px rgba(232, 93, 93, 0.45);
}

@keyframes in-game-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.75);
  }
}
/* ===== PROFILE PAGE (profiles.html) ===== */
.profile-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  color: var(--gold);
  transform: translateX(-2px);
}

.profile-header {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 30px;
  margin: 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 62% 100% at 0% 0%, rgba(200, 155, 60, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 100% at 100% 100%, rgba(42, 109, 194, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(16, 19, 28, 0.98), rgba(10, 12, 18, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.profile-header::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.profile-header-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.profile-avatar-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  display: block;
}

.profile-avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: rgba(200, 155, 60, 0.18);
  filter: blur(24px);
  z-index: 0;
}

.profile-avatar-wrap #profileIcon {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  background: var(--surface2);
  box-shadow: 0 0 0 4px rgba(8, 9, 13, 0.95), 0 12px 26px rgba(0, 0, 0, 0.5);
}

.profile-avatar-wrap #profileRankEmblem {
  position: absolute;
  right: -10px;
  bottom: -8px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 0;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(8, 9, 13, 0.92);
  border: 3px solid rgba(200, 155, 60, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.profile-info {
  min-width: 0;
}

.profile-info h1 {
  margin: 0 0 4px;
  padding: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  text-align: left;
  color: var(--text);
  line-height: 1.05;
}

.profile-info p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.profile-stats-badge {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.rank-title {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold2);
}

.winrate-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.8px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 22px;
  margin: 0;
}

.profile-section-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
  color: var(--text);
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}

.champs-column,
.history-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.champ-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.champ-card:hover {
  transform: translateX(3px);
  background: var(--surface2);
  border-color: rgba(200, 155, 60, 0.35);
}

.champ-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.champ-meta {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.champ-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.champ-wr {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  text-align: right;
}

.game-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.game-win {
  border-left: 4px solid var(--green);
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.08) 0%, var(--surface) 45%);
}

.game-loss {
  border-left: 4px solid var(--red-light);
  background: linear-gradient(90deg, rgba(255, 85, 85, 0.08) 0%, var(--surface) 45%);
}

.game-main-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-champ-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.game-result-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.game-result-text {
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.game-win .game-result-text {
  color: var(--green);
}

.game-loss .game-result-text {
  color: var(--red-light);
}

.game-champ-name {
  font-size: 12px;
  color: var(--muted);
}

.game-kda {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
}

.kda-numbers {
  font-weight: 600;
  color: var(--text);
}

.kda-ratio {
  font-size: 11px;
  color: var(--muted);
}

.game-participants {
  display: grid;
  grid-template-columns: repeat(5, minmax(30px, 1fr));
  gap: 5px;
  align-items: center;
}

.mini-champ-icon {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(200, 155, 60, 0.2);
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-header-main {
    flex-wrap: wrap;
  }

  .profile-stats-badge {
    align-items: flex-start;
    text-align: left;
  }

  .profile-quickstats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Quick stats row (injected via JS) */
.profile-quickstats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
}

.qstat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 14px 10px;
  text-align: center;
  transition: background 0.2s;
}

.qstat-card:hover {
  background: rgba(200, 155, 60, 0.05);
}

.qstat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.qstat-card.wr-good .qstat-value {
  color: var(--green);
}

.qstat-card.wr-bad .qstat-value {
  color: var(--red-light);
}

.qstat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.qstat-champ-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
  margin: 0 auto 4px;
  display: block;
}

@media (max-width: 700px) {
  .profile-quickstats {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-header-main {
    flex-wrap: wrap;
  }
}

/* ---------- Champion mastery cards ---------- */
.champ-mastery-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px 11px 10px;
  overflow: hidden;
  transition: all 0.22s;
}

.champ-mastery-card:hover {
  background: var(--surface2);
  border-color: rgba(200, 155, 60, 0.35);
  transform: translateX(4px);
}

.champ-mastery-rank {
  font-family: var(--font-display);
  font-size: 22px;
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  color: rgba(200, 155, 60, 0.22);
}

.champ-mastery-card.rank-1 .champ-mastery-rank {
  color: var(--gold2);
  text-shadow: 0 0 12px rgba(240, 208, 96, 0.55);
}

.champ-mastery-icon-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.champ-mastery-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.champ-mastery-icon-wrap.wr-good .champ-mastery-icon {
  border-color: var(--green);
}

.champ-mastery-icon-wrap.wr-bad .champ-mastery-icon {
  border-color: var(--red-light);
}

.champ-mastery-body {
  flex-grow: 1;
  min-width: 0;
}

.champ-mastery-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.champ-mastery-name {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champ-mastery-wr {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.champ-mastery-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.champ-progress-track {
  margin-top: 7px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.champ-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #8a6a22, var(--gold2));
}

.champ-progress-fill.wr-bad {
  background: linear-gradient(90deg, #8a2a2a, var(--red-light));
}

/* ---------- Match history cards v2 (profiles.html) ---------- */
.match-card {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 88px 88px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
  min-width: 0;
}

.match-card.match-clickable {
  cursor: pointer;
}

.match-card.match-clickable:hover {
  background: var(--surface2);
  transform: translateX(4px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.match-card.game-win {
  border-left: 4px solid var(--green);
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.09) 0%, var(--surface) 45%);
}

.match-card.game-loss {
  border-left: 4px solid var(--red-light);
  background: linear-gradient(90deg, rgba(255, 85, 85, 0.09) 0%, var(--surface) 45%);
}

.match-champ-icon-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.match-champ-icon {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--border);
}

.game-win .match-champ-icon {
  border-color: rgba(46, 204, 113, 0.55);
}

.game-loss .match-champ-icon {
  border-color: rgba(255, 85, 85, 0.55);
}

.match-result-flag {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-win .match-result-flag {
  background: var(--green);
  color: #04150c;
}

.game-loss .match-result-flag {
  background: var(--red-light);
  color: #2a0606;
}

.match-kda-ratio.kda-legendary {
  color: var(--gold2);
  text-shadow: 0 0 10px rgba(240, 208, 96, 0.5);
}

.match-kda-ratio.kda-great {
  color: var(--green);
}

.match-kda-ratio.kda-bad {
  color: var(--red-light);
}

.match-view-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
}

.match-card.match-clickable:hover .match-view-hint {
  opacity: 1;
  color: var(--gold);
}

.profile-mmr-section {
  margin-top: 18px;
}

.mmr-chart-container {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
}

.mmr-chart-empty {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.mmr-chart-svg {
  display: block;
  width: 100%;
  height: 250px;
}

.mmr-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

/* ---------- Solo match modal (fallback, no full team data) ---------- */
.match-solo-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.match-solo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.match-solo-row:last-child {
  border-bottom: none;
}

.match-solo-row span:first-child {
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 10px;
}

.match-participants-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
/* =========================================================================
   PROFILE PAGE — squelettes de chargement + responsive header
   ========================================================================= */

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.skeleton-line {
  display: inline-block;
  height: 0.85em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.09);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

.skeleton-line-lg {
  width: 220px;
  height: 26px;
}

.skeleton-line-sm {
  width: 130px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.champ-skeleton,
.game-skeleton {
  height: 66px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  margin-bottom: 10px;
}

.game-skeleton {
  height: 78px;
}

@media (max-width: 640px) {
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .profile-stats-badge {
    text-align: left;
  }
}