/* =========================================================================
   Analyse des Licenciés — styles applicatifs
   S'appuie sur charte-graphique-lbcvl.css pour les couleurs/typo de marque.
   ========================================================================= */

:root {
  --viz-surface:      #fcfcfb;
  --viz-text-primary: #0b0b0b;
  --viz-text-secondary: #52514e;
  --viz-muted:        #898781;
  --viz-grid:         #e5e5e5;
  --viz-baseline:     #c3c2b7;

  --series-carambole: #2a78d6; /* slot 1 blue */
  --series-snooker:   #eb6834; /* slot 2 orange */
  --series-blackball: #1baf7a; /* slot 3 aqua */
  --series-americain: #eda100; /* slot 4 yellow */

  --seq-100: #cde2fb; --seq-150: #b7d3f6; --seq-200: #9ec5f4; --seq-250: #86b6ef;
  --seq-300: #6da7ec; --seq-350: #5598e7; --seq-400: #3987e5; --seq-450: #2a78d6;
  --seq-500: #256abf; --seq-550: #1c5cab; --seq-600: #184f95; --seq-650: #104281;
  --seq-700: #0d366b;
}

* { box-sizing: border-box; }

body { background: #f4f6f8; }

.site-header { background: #ffffff; border-bottom: 1px solid var(--color-border); padding: 18px 0; }
.header-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.header-inner .logo { height: 56px; width: auto; }
.header-titles h1 { border: none; margin: 0 0 4px 0; padding: 0; font-size: 24px; line-height: 28px; }
.header-titles .subtitle { margin: 0; color: var(--color-subtext); font-size: 14px; }

.container { max-width: 1320px; margin: 0 auto; padding: 20px; }

/* ---------------------------------------------------------------- Tabs -- */

.tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 2px solid var(--color-border); margin-bottom: 18px;
}
.tab-btn {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 10px 18px; font-size: 15px; font-weight: 600; color: var(--viz-text-secondary);
  border-radius: 8px 8px 0 0; position: relative; top: 2px;
}
.tab-btn:hover { color: var(--color-primary); background: #eef4fb; }
.tab-btn.active {
  color: var(--color-primary); background: #ffffff;
  border: 2px solid var(--color-border); border-bottom: 2px solid #ffffff;
}
.tab-add-btn {
  appearance: none; border: 2px dashed var(--color-border); background: transparent; cursor: pointer;
  padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--viz-muted);
  border-radius: 8px; margin-left: 6px;
}
.tab-add-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* ----------------------------------------------------------- Tab panel -- */

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-toolbar {
  background: #ffffff; border: 1px solid var(--color-border); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-group label { font-size: 13px; font-weight: 600; color: var(--viz-text-secondary); white-space: nowrap; }

.file-input {
  font-size: 13px; max-width: 260px;
}
.file-status { font-size: 13px; color: var(--viz-muted); }
.file-status.ok { color: #006300; font-weight: 600; }
.file-status.err { color: #a94442; font-weight: 600; }

.ligue-select {
  font-size: 14px; padding: 7px 10px; border-radius: 6px;
  background: #ffffff; color: var(--viz-text-primary); border: 1px solid var(--color-border-input);
  min-width: 240px;
}

.summary-chips { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.chip {
  background: #eef4fb; color: var(--color-primary); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.chip .chip-value { font-size: 15px; }

.empty-state {
  background: #ffffff; border: 1px dashed var(--color-border); border-radius: 10px;
  padding: 40px 20px; text-align: center; color: var(--viz-muted); font-size: 14px;
}

/* -------------------------------------------------------------- Grid --- */

.cadrans-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start;
}
/* Cadran 3 (âge moyen, bulles) et cadran 4 (clubs) occupent chacun leur propre
   ligne sur toute la largeur : le 3 reste compact, le 4 est agrandi au maximum. */
#c-avgage, #c-clubs { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .cadrans-grid { grid-template-columns: 1fr; }
}

.cadran {
  background: #ffffff; border: 1px solid var(--color-border); border-radius: 10px;
  padding: 16px 18px 18px; min-height: 340px; display: flex; flex-direction: column;
  min-width: 0; /* les items de grille ont min-width:auto par défaut : sans ce
                   reset, un canvas large (cadran clubs) fait grandir toute la
                   colonne de grille au lieu de défiler. */
}
.cadran.cadran-compact { min-height: auto; }
.cadran-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cadran-title { font-size: 15px; font-weight: 700; color: var(--viz-text-primary); margin: 0; }
.cadran-note { font-size: 12px; color: var(--viz-muted); margin: 0 0 10px 0; }
.cadran-body { flex: 1; position: relative; min-height: 260px; min-width: 0; }
.cadran-compact .cadran-body { min-height: auto; }

/* -------------------------------------------------------- Carte France - */

.map-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.map-svg-wrap { flex: 1 1 360px; min-width: 300px; }
.map-svg-wrap svg { width: 100%; height: auto; display: block; }

.map-tile-name { font-size: 8.6px; font-weight: 700; }
.map-tile-value { font-size: 12.5px; font-weight: 800; }
.map-tile-rect { transition: opacity .15s ease, stroke-width .15s ease; cursor: default; }
.map-tile-group.dim .map-tile-rect { opacity: .35; }
.map-tile-group.selected .map-tile-rect { stroke: #0b0b0b; stroke-width: 2.5; }

.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--viz-muted); }
.map-legend-ramp { flex: 1; height: 10px; border-radius: 5px; background: linear-gradient(to right, var(--seq-100), var(--seq-700)); }

.domtom-box { flex: 0 0 150px; }
.domtom-box h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--viz-muted); margin: 0 0 8px; font-weight: 700; }
.domtom-tile {
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; font-weight: 700;
}
.domtom-tile .dt-count { font-size: 16px; display: block; }

.selected-callout {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #eef4fb;
  font-size: 13px; color: var(--color-primary-darker); font-weight: 600;
}

/* ------------------------------------------------------------- Bulles -- */

.age-bubbles-wrap {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: 16px; padding: 6px 4px 2px;
}
.age-bubble-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.age-bubble {
  border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #ffffff; font-weight: 800; line-height: 1.05; flex-shrink: 0;
}
.age-bubble .age-bubble-unit { font-weight: 600; opacity: .85; font-size: .55em; }
.age-bubble-label { font-size: 11.5px; font-weight: 700; color: var(--viz-text-secondary); text-align: center; max-width: 108px; }
.age-bubble-sub { font-size: 10.5px; color: var(--viz-muted); text-align: center; }

/* --------------------------------------------------------- Club chart -- */

.club-search {
  width: 100%; max-width: 360px; padding: 6px 10px; font-size: 13px; border: 1px solid var(--color-border-input);
  border-radius: 6px; margin-bottom: 10px; color: var(--viz-text-primary); background: #fff;
}
.club-chart-scroll { overflow-x: auto; overflow-y: hidden; position: relative; padding-bottom: 6px; }
.club-chart-scroll canvas { display: block; max-width: none; }
.club-chart-hint { font-size: 11.5px; color: var(--viz-muted); margin: 6px 0 0; }

.discipline-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; }
.legend-chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--viz-text-secondary); }
.legend-chip .legend-swatch { width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* --------------------------------------------------------------- Misc -- */

.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; padding: 22px 24px; width: 340px; max-width: 90vw; }
.modal-box h3 { margin-top: 0; font-size: 17px; border: none; padding: 0; }
.modal-box input[type="number"], .modal-box input[type="text"] {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--color-border-input);
  color: var(--viz-text-primary); background: #fff; margin: 10px 0 16px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--color-border); border-radius: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--viz-text-secondary); cursor: pointer;
}
.btn-primary-sm {
  background: var(--color-primary); color: #fff; border: none; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-primary-sm:hover { background: var(--color-primary-dark); }

.site-footer { margin-top: 40px; padding: 18px 0; text-align: center; }
.site-footer p { margin: 0; font-size: 13px; }

canvas { max-width: 100%; }
