/* =============================================
   KOLIZION — Page Statistiques Globales
   global-stats.css
   ============================================= */

/* La page globale n'a pas de sidebar : annuler le margin-left du footer */
.site-footer {
  margin-left: 0;
}

/* ─── Reset page ───────────────────────────── */
body::before { display: none !important; }
body {
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  isolation: isolate;
}

/* ─── Header ───────────────────────────────── */
.gs-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
}
.gs-header-left  { display: flex; align-items: center; gap: 20px; }
.gs-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.gs-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: .1em;
  text-decoration: none;
  white-space: nowrap;
}
.gs-logo-sub {
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .05em;
}

/* ─── Filtres globaux ──────────────────────── */
.gs-filters-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 58px;
  z-index: 90;
}
.gs-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gs-filter-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.gs-tab-group {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.gs-tab {
  padding: 5px 14px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.gs-tab.active, .gs-tab:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.gs-tab.active { color: var(--gold); }

.gs-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  padding: 5px 10px;
  cursor: pointer;
}
.gs-select:focus { outline: none; border-color: var(--border-accent); }

/* ─── Layout principal ─────────────────────── */
.gs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ─── Section ──────────────────────────────── */
.gs-section {
  margin-bottom: 48px;
}
.gs-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.gs-section-title {
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  color: var(--gold);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.gs-section-sub {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ─── Grille KPI ────────────────────────────── */
.gs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.gs-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-align: center;
}
.gs-kpi-value {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold);
  line-height: 1.1;
}
.gs-kpi-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ─── Chart container ──────────────────────── */
.gs-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
}
.gs-chart-title {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

/* ─── Deux colonnes ─────────────────────────── */
.gs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gs-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .gs-two-col { grid-template-columns: 1fr; }
  .gs-three-col { grid-template-columns: 1fr 1fr; }
  .gs-header { padding: 0 16px; }
  .gs-filters-bar { padding: 10px 16px; }
  .gs-container { padding: 24px 16px 56px; }
}
@media (max-width: 600px) {
  .gs-header {
    height: auto;
    min-height: 52px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    top: auto;
  }
  .gs-logo-sub { display: none; }
  .gs-header-right { flex-wrap: wrap; }

  .gs-filters-bar {
    padding: 10px 14px;
    gap: 10px;
    position: relative;
    top: auto;
  }
  .gs-filter-group { flex-wrap: wrap; }
  .gs-tab-group { flex-wrap: wrap; }
  .gs-tab { padding: 5px 10px; font-size: .8rem; }

  .gs-three-col { grid-template-columns: 1fr; }
  .gs-kpi-grid  { grid-template-columns: repeat(2, 1fr); }
  .gs-container { padding: 16px 12px 40px; }

  .gs-records-grid { grid-template-columns: repeat(2, 1fr); }
  .gs-section-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ─── Tableau classement ────────────────────── */
.gs-rank-table {
  width: 100%;
  border-collapse: collapse;
}
.gs-rank-table th {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.gs-rank-table td {
  padding: 9px 10px;
  font-size: .88rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.gs-rank-table tr:last-child td { border-bottom: none; }
.gs-rank-table tr:hover td { background: rgba(255,255,255,.025); }
.gs-wr-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--bg-elevated);
}
.gs-wr-pill.high { color: var(--green); background: var(--green-dim); }
.gs-wr-pill.low  { color: var(--red);   background: var(--red-dim); }
.gs-wr-pill.mid  { color: var(--gold);  background: var(--gold-dim); }

/* ─── Heatmap matchups ──────────────────────── */
.gs-heatmap-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
}
.gs-heatmap-note {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.gs-heatmap {
  border-collapse: collapse;
  font-size: .72rem;
  white-space: nowrap;
}
.gs-heatmap th, .gs-heatmap td {
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.04);
  text-align: center;
}
.gs-heatmap th {
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg-elevated);
}
.gs-heatmap th.row-header {
  text-align: right;
  min-width: 80px;
  position: sticky;
  left: 0;
  background: var(--bg-elevated);
  z-index: 2;
}
.gs-heatmap .col-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-elevated);
}
.gs-heatmap td.hidden-cell {
  color: var(--text-muted);
  font-size: .65rem;
  background: var(--bg-surface) !important;
}
.gs-heatmap td.self-cell {
  background: var(--bg-elevated) !important;
  color: var(--text-muted);
}

/* Couleurs heatmap : vert fort = bon WR, rouge fort = mauvais WR */
.gs-hm-90 { background: rgba(74,222,128,.30); color: #4ade80; }
.gs-hm-70 { background: rgba(74,222,128,.16); color: #a0f0c0; }
.gs-hm-55 { background: rgba(74,222,128,.07); color: var(--text-secondary); }
.gs-hm-45 { background: rgba(248,113,113,.07); color: var(--text-secondary); }
.gs-hm-30 { background: rgba(248,113,113,.16); color: #fca5a5; }
.gs-hm-10 { background: rgba(248,113,113,.30); color: #f87171; }

/* ─── Top 10 listes ────────────────────────── */
.gs-top-list {
  list-style: none;
}
.gs-top-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .88rem;
}
.gs-top-list li:last-child { border-bottom: none; }
.gs-top-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.gs-top-rank.gold  { background: var(--gold-dim);  color: var(--gold); }
.gs-top-rank.silver{ background: rgba(192,192,192,.12); color: #c0c0c0; }
.gs-top-rank.bronze{ background: rgba(205,127,50,.12); color: #cd7f32; }
.gs-top-name { flex: 1; color: var(--text-primary); }
.gs-top-meta { font-size: .78rem; color: var(--text-muted); }

/* ─── Barre de WR inline ────────────────────── */
.gs-wr-bar-wrap { display: flex; align-items: center; gap: 8px; }
.gs-wr-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.gs-wr-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.gs-wr-bar-fill.green { background: var(--green); }
.gs-wr-bar-fill.red   { background: var(--red); }
.gs-wr-bar-fill.gold  { background: var(--gold); }

/* ─── Tableau comparaison saisons ──────────── */
.gs-season-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  padding: 0;
}
.gs-season-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.gs-season-table th {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  white-space: nowrap;
}
.gs-season-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.gs-season-table tr:last-child td { border-bottom: none; }
.gs-season-table tr:hover td { background: rgba(255,255,255,.025); }
.gs-badge-active {
  display: inline-block;
  padding: 2px 8px;
  background: var(--green-dim);
  color: var(--green);
  border-radius: 10px;
  font-size: .72rem;
}
.gs-tag {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-elevated);
  border-radius: 10px;
  font-size: .75rem;
  color: var(--text-secondary);
  margin: 1px 2px;
}

/* ─── Records ────────────────────────────────── */
.gs-records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.gs-record-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.gs-record-icon { font-size: 2rem; margin-bottom: 8px; }
.gs-record-value {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--gold);
}
.gs-record-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 4px;
}

/* ─── Méta du moment ─────────────────────────── */
.gs-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.gs-meta-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.gs-meta-rank { font-size: .68rem; color: var(--text-muted); margin-bottom: 4px; }
.gs-meta-name { font-size: .9rem; color: var(--text-primary); font-weight: 500; }
.gs-meta-wr   { font-size: .78rem; color: var(--green); margin-top: 2px; }

/* ─── Modale fiche classe ────────────────────── */
.gs-class-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.gs-class-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.gs-class-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-glow);
  transform: translateY(12px);
  transition: transform .25s ease;
}
.gs-class-modal-overlay.open .gs-class-modal { transform: translateY(0); }
.gs-class-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 5;
}
.gs-class-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold);
}
.gs-class-modal-body { padding: 20px 24px 28px; }
.gs-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
  transition: color .2s;
}
.gs-modal-close:hover { color: var(--text-primary); }

/* ─── Sub-sections dans la modale ───────────── */
.gs-modal-section { margin-bottom: 20px; }
.gs-modal-section-title {
  font-size: .72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.gs-matchup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: .86rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.gs-matchup-row:last-child { border-bottom: none; }
.gs-matchup-class { flex: 1; }
.gs-matchup-total { font-size: .75rem; color: var(--text-muted); }

/* ─── Distribution cote (histogramme simple) ─── */
.gs-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: .8rem;
}
.gs-dist-label { width: 60px; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.gs-dist-bar {
  flex: 1;
  height: 16px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.gs-dist-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  opacity: .7;
  transition: width .4s ease;
}
.gs-dist-count { width: 40px; color: var(--text-secondary); font-size: .75rem; }

/* ─── Skeleton loading ──────────────────────── */
@keyframes gs-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.gs-skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 400px 100%;
  animation: gs-shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  height: 16px;
}

/* ─── Boutons classe (grid cliquable) ─────────── */
.gs-class-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.gs-class-btn {
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.gs-class-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* ─── Loading overlay ─────────────────────────── */
.gs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: .9rem;
  gap: 10px;
}
.gs-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty state ──────────────────────────────── */
.gs-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: .88rem;
}

/* ─── Bouton CTA "Voir la page" (auth page) ──── */
.gs-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--gold);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition);
  white-space: nowrap;
}
.gs-hero-btn:hover {
  background: rgba(212,175,55,.25);
  box-shadow: var(--shadow-glow);
}

/* ─── Sidebar link special ─────────────────────── */
.nav-link.gs-public-link {
  color: var(--teal);
}
.nav-link.gs-public-link:hover,
.nav-link.gs-public-link:focus {
  color: var(--teal);
  background: var(--teal-dim);
}