:root {
  --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --color-bg: #f8fafc;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-card-bg: #ffffff;
  --color-border: #e2e8f0;
  --color-primary: #2563eb;
  --color-team-a: #2563eb;
  --color-team-b: #ea580c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.5;
}

html {
  scroll-behavior: smooth;
}

header, .app-header {
  background: #0f172a;
  color: #ffffff;
  padding: 12px clamp(16px, 3.5vw, 48px);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-brand {
  display: flex;
  flex-direction: column;
}

.header-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #ffffff;
}

.header-brand p {
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 0.82rem;
}

.header-nav-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-tab {
  color: #94a3b8;
  text-decoration: none;
  background: transparent;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.nav-tab:hover {
  color: #ffffff;
  background: #1e293b;
}

.nav-tab.is-active {
  color: #ffffff;
  background: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-tab-badge {
  background: #ea580c;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
}

.nav-tab-highlight {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.nav-tab-highlight:hover {
  background: rgba(37, 99, 235, 0.25);
  color: #ffffff;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-header-add {
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-header-add:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-header-export {
  background: #1e293b;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 11px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.btn-header-export:hover {
  background: #334155;
  color: #ffffff;
}

.btn-header-logout {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-header-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.btn-header-password {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-header-password:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

main {
  padding: 28px clamp(16px, 4vw, 56px);
  max-width: 1500px;
  margin: 0 auto;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.panel {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  margin-bottom: 28px;
}

/* Grille des cartes joueurs */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.score-badge {
  background: #eff6ff;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

/* Conteneur circulaire non-écrasé pour les toiles radar */
.radar-box {
  position: relative;
  width: 100%;
  max-width: 275px;
  aspect-ratio: 1;
  margin: 4px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-box canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Bandeau de statistiques sous les cartes */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: auto;
  font-size: 0.88rem;
}

.stat-strip span {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  color: #334155;
}

.stat-strip span b {
  color: var(--color-text);
  font-size: 0.95rem;
}

/* Tableaux généraux */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card-bg);
  text-align: left;
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fbfcfe;
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.footnote {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin-top: 8px;
}

/* Système d'onglets pour les 3 propositions d'équipes */
.tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  padding: 11px 22px;
  border-radius: 12px 12px 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 -2px 10px rgba(37, 99, 235, 0.2);
}

.proposal-panel {
  display: none;
}

.proposal-panel.active {
  display: block;
}

/* Équilibrage des équipes : Grille en 3 colonnes */
.teams-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 22px;
  align-items: stretch;
  margin-top: 16px;
}

.team-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}

.team-card.team-a {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 180px);
}

.team-card.team-b {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 180px);
}

.team-header-a {
  color: var(--color-team-a);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.team-header-b {
  color: var(--color-team-b);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ffedd5;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.team-players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.player-tag {
  background: #ffffff;
  border: 1px solid var(--color-border);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-left: 10px;
  vertical-align: middle;
}

/* Agrandissement des toiles radar pour occuper toute la largeur des 3 colonnes */
.team-card .radar-box {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 12px auto 0;
}

.center-comparison-card .radar-box {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 12px auto 0;
}

/* Bloc central récapitulatif des écarts */
.center-comparison-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Alignement tableau VS : Équipe 1 (Gauche) | Diff (+/- orienté au centre) | Équipe 2 (Droite) */
.vs-table th.col-a, .vs-table td.col-a {
  text-align: right;
  color: var(--color-team-a);
  font-weight: 600;
  padding-right: 18px;
}

.vs-table th.col-diff, .vs-table td.col-diff {
  text-align: center;
  width: 120px;
}

.vs-table th.col-b, .vs-table td.col-b {
  text-align: left;
  color: var(--color-team-b);
  font-weight: 600;
  padding-left: 18px;
}

/* Badges d'écarts orientés (+/-) avec triangles vectoriels purs */
.diff-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  min-width: 82px;
  text-align: center;
  letter-spacing: 0.01em;
  gap: 5px;
}

.diff-pill.side-a {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.diff-pill.side-a::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  border-right: 6px solid currentColor;
}

.diff-pill.side-b {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.diff-pill.side-b::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  border-left: 6px solid currentColor;
}

.diff-pill.side-eq {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Module Comparateur Face-à-Face de 2 joueurs */
.comparator-panel {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  margin-top: 32px;
}

.comparator-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.vs-badge {
  font-weight: 900;
  font-size: 1.1rem;
  color: #94a3b8;
  background: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
}

.selector-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selector-group label {
  font-weight: 600;
  font-size: 0.88rem;
}

.selector-group.p1 label {
  color: var(--color-team-a);
}

.selector-group.p2 label {
  color: var(--color-team-b);
}

.comparator-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 28px;
  align-items: center;
}

.comparator-radar-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  margin: 0 auto;
}

/* Formulaires et Boutons */
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 16px 0 22px;
}

.checks label, .check {
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checks label:hover, .check:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  font-size: 0.92rem;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button, .btn {
  font-family: inherit;
  border: 0;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover, .btn:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.wide {
  grid-column: 1 / -1;
}

/* Adaptabilité mobile */
@media (max-width: 1050px) {
  .teams-comparison-grid {
    grid-template-columns: 1fr;
  }
  .comparator-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .comparator-selectors {
    grid-template-columns: 1fr;
  }
  .vs-badge {
    margin: 0 auto;
  }
  .stat-strip {
    grid-template-columns: 1fr;
  }
}

/* Profils qualitatifs et Étiquettes */
.profile-dominant {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  margin-top: 2px;
  margin-bottom: 6px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 8px;
  line-height: 1.3;
}

.profile-summary {
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 8px 0 14px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border-left: 3px solid #3b82f6;
}

.player-dominant-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.card-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.edit-player-link {
  color: #64748b;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.edit-player-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.comparator-profile-badge {
  margin-top: 8px;
}

.tags-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 20px;
}

.tag-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tag-checkbox-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.tag-checkbox-item input[type="checkbox"]:checked + span {
  color: #4338ca;
  font-weight: 600;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.zone-prompt {
  background: #0f172a;
  color: #f8fafc;
  padding: 16px 20px;
  border-radius: 12px;
  font-family: "Cascadia Code", "Fira Code", Consolas, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #334155;
}

/* ==========================================================================
   Tableau des joueurs filtrable & Volet latéral rétractable (Off-Canvas)
   ========================================================================== */

.players-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.players-toolbar h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-count-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 9999px;
  vertical-align: middle;
}

.player-search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 380px;
}

.player-search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.player-search-box input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.player-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
}

/* Tableau d'effectif */
.players-table-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.players-table-card table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.players-table-card th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 18px;
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
}

.players-table-card td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.93rem;
  vertical-align: middle;
}

.player-table-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.player-table-row:hover {
  background-color: #f8fafc;
}

.player-table-row.is-selected {
  background-color: #eff6ff !important;
}

.player-table-name {
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-table-dominant {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.player-table-dominant:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

.has-tooltip {
  cursor: help;
  position: relative;
}

.tooltip-icon {
  font-size: 0.72rem;
  color: #64748b;
  opacity: 0.75;
  transition: opacity 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.has-tooltip:hover .tooltip-icon {
  opacity: 1;
  color: #2563eb;
}

.global-floating-tooltip {
  position: fixed;
  z-index: 9999;
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
}

.global-floating-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.player-table-action-btn {
  background: transparent;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.player-table-action-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Volet latéral (Off-Canvas Drawer) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.player-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 95vw;
  background: #ffffff;
  z-index: 1250;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  padding: 22px 24px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.drawer-title-area {
  flex: 1;
}

.drawer-player-name {
  margin: 0 0 6px 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.drawer-dominant {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #93c5fd;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Les blocs gardent leur hauteur naturelle : c'est le volet qui défile.
   Sans cela, la carte collector (overflow: hidden) est écrasée à ~40 px
   dès que le contenu dépasse la hauteur de l'écran. */
.drawer-body > * {
  flex-shrink: 0;
}

.drawer-radar-box {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-radar-box canvas {
  max-width: 100% !important;
  max-height: 280px !important;
}

.drawer-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Barres de compétences détaillées */
.drawer-skills-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.drawer-skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}

.drawer-skill-row:last-child {
  margin-bottom: 0;
}

.drawer-skill-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  width: 130px;
}

.drawer-skill-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.drawer-skill-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.drawer-skill-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  width: 35px;
  text-align: right;
}

/* Grille de stats compacte */
.drawer-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.drawer-stat-tile {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.drawer-stat-tile .tile-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.drawer-stat-tile .tile-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.drawer-summary-box {
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
  border-radius: 0 8px 8px 0;
}

.drawer-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
}

.drawer-footer .btn-edit {
  width: 100%;
  text-align: center;
  background: #2563eb;
  color: #ffffff;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.drawer-footer .btn-edit:hover {
  background: #1d4ed8;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .player-drawer {
    width: 100%;
    max-width: 100vw;
  }
  .players-table-card th:nth-child(4),
  .players-table-card td:nth-child(4),
  .players-table-card th:nth-child(7),
  .players-table-card td:nth-child(7) {
    display: none;
  }
  .match-teams-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Mise en page des équipes pour les matchs (Équipe A vs Équipe B)
   ========================================================================== */

.match-teams-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 10px 0 16px;
}

.match-team-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1.5px solid var(--color-border);
}

.team-a-box {
  border-color: #bfdbfe;
  background: #f8faff;
}

.team-b-box {
  border-color: #fed7aa;
  background: #fffaf5;
}

.match-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.match-team-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.team-a-box .match-team-header h3 {
  color: #1d4ed8;
}

.team-b-box .match-team-header h3 {
  color: #c2410c;
}

.team-counter {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  color: #475569;
}

.team-a-box .team-counter {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.team-b-box .team-counter {
  border-color: #fdba74;
  color: #c2410c;
}

.team-checks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.check-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.check-player:hover {
  border-color: #94a3b8;
}

.check-player.is-disabled {
  opacity: 0.35;
  background: #f1f5f9;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-sm:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==========================================================================
   Sas d'évaluation & d'évolution IA (Option B)
   ========================================================================== */

.badge-diff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 48px;
}

.badge-diff.up {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-diff.down {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.badge-diff.eq {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.ai-rationale-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.history-match-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.history-match-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.history-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
}

.history-match-observation {
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  padding: 8px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: #1e293b;
  line-height: 1.45;
}

.diff-comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.diff-comparison-table th,
.diff-comparison-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.diff-comparison-table th {
  background: #f8fafc;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

/* ============================================================
   Tableau de bord & Cartes KPIs
   ============================================================ */

.dashboard-section {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px clamp(16px, 2.8vw, 28px);
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 85px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.season-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 84px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.kpi-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.kpi-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.kpi-subtext {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.35;
  white-space: normal;
}

/* ============================================================
   Bandeau de Débriefing IA
   ============================================================ */

.debrief-banner-alert {
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.debrief-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.debrief-banner-content {
  flex: 1;
  min-width: 240px;
}

.debrief-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 3px;
}

.debrief-pending-count {
  background: #ea580c;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
}

.debrief-banner-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #1e40af;
  line-height: 1.45;
}

.debrief-banner-synced {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Badges d'état de match */
.badge-status-debriefed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-status-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.match-debrief-summary-chip {
  margin-top: 6px;
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  padding: 5px 9px;
  border-radius: 0 4px 4px 0;
  font-size: 0.8rem;
  color: #166534;
  line-height: 1.35;
}

/* ============================================================
   Hub d'Accueil : Grandes Dalles d'Orientation
   ============================================================ */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0 32px;
}

.hub-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: #93c5fd;
}

.hub-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.hub-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.hub-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.hub-card-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 20px;
}

.hub-card-action {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   CARTE DE JOUEUR COLLECTOR & PARTAGE WHATSAPP / TEAMS
   ========================================================================== */

.player-collectible-card {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  border: 2px solid #eab308;
  border-radius: 16px;
  padding: 20px;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 0 15px rgba(234, 179, 8, 0.2);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.player-collectible-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.card-top-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(234, 179, 8, 0.3);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.card-badge-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fde047;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
}

.card-identity-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.card-name-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.card-dominant-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #60a5fa;
}

.card-score-shield {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #0f172a;
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.35);
  flex-shrink: 0;
}

.card-score-main {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

.card-score-sub {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-top: 2px;
}

.card-desc-box {
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid #eab308;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #e2e8f0;
  margin-bottom: 16px;
}

.card-strengths-section {
  margin-bottom: 16px;
}

.card-section-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-strengths-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-strength-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.card-strength-name {
  font-weight: 600;
  color: #f1f5f9;
}

.card-strength-val {
  font-weight: 800;
  color: #fde047;
  background: rgba(234, 179, 8, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.card-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.card-stat-box .card-stat-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: #38bdf8;
  display: block;
}

.card-stat-box .card-stat-lbl {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-top: 2px;
}

.btn-whatsapp-share {
  background: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-whatsapp-share:hover {
  background: #1eb954;
  transform: translateY(-1px);
}

.btn-whatsapp-share:active {
  transform: translateY(1px);
}

/* Carte image (principal) + copie texte (secondaire), comme sur /teams */
.card-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-share-actions .btn-whatsapp-share {
  width: auto;
  flex: 1 1 auto;
}

.btn-card-share-text {
  flex: 1 1 auto;
  background: transparent;
  color: #86efac;
  border: 1.5px solid rgba(134, 239, 172, 0.55);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-card-share-text:hover {
  background: rgba(134, 239, 172, 0.12);
}

/* Global Toast Notification */
.global-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #38bdf8;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.global-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}




