/* ============================================================
   pairing-matrix-v11.css
   Spécifique à la Pairing Matrix V11. S'appuie sur les tokens de
   base.css (dark/light via data-theme) + composants de primaire.css
   (.pr-panel, .field, .btn, .modal, .sec-hd…). Scope : .pv11-wrap.
   Aucune couleur en dur : tout passe par les variables de thème.
   ============================================================ */

/* Alias locaux requis par les composants empruntés à primaire.css
   (.btn, .btn--accent, .field, .modal, .lang-switch…) qui référencent
   --red / --gold / --line2 / --bg2, variables que primaire.css scope à
   .pr-wrap. On les remappe ici sur les tokens globaux de base.css pour
   que ces composants s'affichent correctement (et lisiblement en dark). */
.pv11-wrap,
.ornaments .pv11-wrap {
  --bg2:         var(--bg-2);
  --line2:       var(--line-2);
  --gold:        var(--accent);
  --gold-bright: var(--accent-b);
  --gold-dim:    var(--accent);
  --red:         var(--accent);
  --red-bright:  var(--accent-b);
}

/* Largeur lisible + marges latérales responsive, comme .pr-wrap de primaire.
   (.container global n'apporte ni max-width ni padding ; c'est le wrapper de
   chaque outil qui les porte.) */
.pv11-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 36px) 80px;
}

/* Panneaux/sections : .pr-panel n'a pas de style « carte » en propre dans
   primaire.css, on le définit ici (scopé .pv11-wrap pour ne rien casser ailleurs). */
.pv11-wrap .pr-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 22px);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.pv11-wrap .sec-hd:first-child { margin-top: 0; }

/* ── Muted / hints ── */
.pv11-muted { color: var(--txt-3); font-size: .85rem; }
.pv11-hint { font-family: var(--mono); font-size: .72rem; color: var(--txt-3); }

/* ── Cartes de sélection (équipe / matrice) — façon tool-card ── */
.pv11-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pv11-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, background .15s, transform .15s;
}
.pv11-card:hover { border-color: var(--accent); background: var(--panel-2); transform: translateY(-2px); }
.pv11-card__title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--txt); }
.pv11-card__meta { font-family: var(--mono); font-size: .72rem; color: var(--txt-3); letter-spacing: .04em; }
.pv11-card__actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

/* ── Cartes de modes (hub étape 3) ── */
.pv11-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pv11-mode {
  position: relative; display: block;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 18px; text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.pv11-mode:hover { border-color: var(--accent); background: var(--panel-2); transform: translateY(-2px); }
.pv11-mode--disabled { opacity: .5; pointer-events: none; }
.pv11-mode__icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--radius2); background: var(--bg-2); color: var(--accent); margin-bottom: 10px; }
.pv11-mode__icon .material-symbols-outlined { font-size: 24px; }
.pv11-mode h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 6px; color: var(--txt); }
.pv11-mode p { font-size: .85rem; color: var(--txt-2); line-height: 1.45; margin: 0; }
.pv11-mode__foot { margin-top: 12px; font-family: var(--mono); font-size: .7rem; color: var(--txt-3); text-transform: uppercase; letter-spacing: .08em; }

/* ── Contexte (bandeau équipe • matrice) ── */
.pv11-context { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: .78rem; color: var(--txt-2); margin-bottom: 14px; }
.pv11-context .material-symbols-outlined { font-size: 16px; vertical-align: middle; margin-right: 4px; color: var(--accent); }
.pv11-context__sep { color: var(--txt-3); }

/* ── Inputs génériques (réutilise l'esprit .field de primaire.css) ── */
.pv11-field { display: flex; flex-direction: column; gap: 6px; }
.pv11-field label { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--txt-2); }
.pv11-input, .pv11-select {
  background: var(--bg-2); color: var(--txt);
  border: 1px solid var(--line-2); border-radius: var(--radius2);
  padding: 9px 10px; font-size: .9rem; font-family: var(--font);
}
.pv11-input:focus, .pv11-select:focus { outline: none; border-color: var(--accent); }
.pv11-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.pv11-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ── Roster ── */
.pv11-roster { display: flex; flex-direction: column; gap: 8px; }
.pv11-roster-row { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 8px; align-items: center; }
.pv11-roster-row__num { font-family: var(--mono); font-size: .75rem; color: var(--txt-3); }

/* ── Matrice d'estimation 0-20 ── */
.pv11-matrix-scroll { overflow-x: auto; }
.pv11-matrix { border-collapse: collapse; width: 100%; font-size: .82rem; }
.pv11-matrix th, .pv11-matrix td { border: 1px solid var(--line); padding: 4px; text-align: center; }
.pv11-matrix th { background: var(--bg-2); color: var(--txt-2); font-family: var(--mono); font-size: .68rem; font-weight: 600; position: sticky; }
.pv11-matrix .pv11-matrix__rowlabel { text-align: left; background: var(--bg-2); color: var(--txt-2); white-space: nowrap; font-family: var(--mono); font-size: .7rem; }
.pv11-matrix input { width: 42px; text-align: center; background: transparent; border: none; color: inherit; font-size: .85rem; font-weight: 600; }
.pv11-matrix input:focus { outline: 1px solid var(--accent); }

/* Classes de score (tons dérivés des tokens de thème) */
.pv11-score-low  { background: color-mix(in srgb, var(--danger) 26%, var(--panel)); color: var(--txt); }
.pv11-score-mid  { background: color-mix(in srgb, var(--danger) 12%, var(--panel)); color: var(--txt); }
.pv11-score-even { background: var(--panel); color: var(--txt-2); }
.pv11-score-good { background: color-mix(in srgb, var(--success) 14%, var(--panel)); color: var(--txt); }
.pv11-score-max  { background: color-mix(in srgb, var(--success) 28%, var(--panel)); color: var(--txt); }

/* ── Aperçu de séquence de modules ── */
.pv11-seq { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pv11-seq__chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--radius2);
  padding: 6px 10px; font-family: var(--mono); font-size: .72rem; color: var(--txt-2);
  background: var(--bg-2);
}
.pv11-seq__chip[data-type="skirmish"] { border-left: 3px solid var(--accent); }
.pv11-seq__chip[data-type="main"] { border-left: 3px solid var(--accent-b); }
.pv11-seq__chip[data-type="champion"] { border-left: 3px solid var(--badge-new); }

/* ── Cartes de module (mode live) ── */
.pv11-modules { display: flex; flex-direction: column; gap: 14px; }
.pv11-module {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 16px;
  border-top: 3px solid var(--line-2);
}
.pv11-module--active { border-top-color: var(--accent); box-shadow: var(--shadow); }
.pv11-module--done { opacity: .72; border-top-color: var(--success); }
.pv11-module__hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.pv11-module__title { font-family: var(--font-display); font-size: 1rem; color: var(--txt); }
.pv11-module__badge { font-family: var(--mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; border: 1px solid var(--line-2); border-radius: var(--radius2); padding: 2px 7px; color: var(--txt-2); }
.pv11-step { display: flex; flex-direction: column; gap: 10px; }
.pv11-step__label { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pv11-suggest-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  border-radius: var(--radius2); padding: 6px 10px; cursor: pointer; font-size: .8rem;
}
.pv11-suggest-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Matchups résolus */
.pv11-resolved { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pv11-resolved-row {
  display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius2); padding: 8px 10px; background: var(--bg-2);
  font-size: .85rem;
}
.pv11-resolved-row .pv11-vs { font-family: var(--mono); font-size: .7rem; color: var(--txt-3); }
.pv11-kind { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-3); }

/* ── Tableau BP/TP (résultats) ── */
.pv11-results { width: 100%; border-collapse: collapse; font-size: .86rem; }
.pv11-results th, .pv11-results td { border: 1px solid var(--line); padding: 8px; text-align: center; }
.pv11-results th { background: var(--bg-2); color: var(--txt-2); font-family: var(--mono); font-size: .68rem; }
.pv11-results td input { width: 64px; text-align: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius2); color: var(--txt); padding: 5px; }
.pv11-outcome { font-family: var(--font-display); font-size: 1.1rem; padding: 4px 12px; border-radius: var(--radius2); display: inline-block; }
.pv11-outcome--win  { background: color-mix(in srgb, var(--success) 22%, var(--panel)); color: var(--txt); }
.pv11-outcome--draw { background: var(--bg-2); color: var(--txt-2); }
.pv11-outcome--loss { background: color-mix(in srgb, var(--danger) 22%, var(--panel)); color: var(--txt); }

/* ── Total estimation (mode prévision) ── */
.pv11-total { font-family: var(--font-display); font-size: 1.6rem; }
.pv11-total-low  { color: var(--danger); }
.pv11-total-mid  { color: var(--txt-2); }
.pv11-total-high { color: var(--success); }

/* ── Jauge SVG ── */
.pv11-gauge-row { display: flex; gap: 20px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pv11-gauge { position: relative; width: 120px; height: 120px; }
.pv11-gauge__arc { transition: stroke-dashoffset .4s ease; }
.pv11-gauge__arc.pv11-total-low  { color: var(--danger); }
.pv11-gauge__arc.pv11-total-mid  { color: var(--accent); }
.pv11-gauge__arc.pv11-total-high { color: var(--success); }
.pv11-gauge__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pv11-gauge__meta { display: flex; flex-direction: column; gap: 4px; }
.pv11-gauge__label { font-family: var(--font-display); font-size: 1rem; margin-top: 4px; }
.pv11-gauge__label.pv11-total-low  { color: var(--danger); }
.pv11-gauge__label.pv11-total-mid  { color: var(--txt-2); }
.pv11-gauge__label.pv11-total-high { color: var(--success); }

/* ── Preview markdown (modale liste) ── */
.pv11-md-preview { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius2); background: var(--bg-2); font-size: .85rem; color: var(--txt-2); max-height: 240px; overflow: auto; }
.pv11-md-preview:empty { display: none; }

/* ── États (vide / chargement) ── */
.pv11-empty { color: var(--txt-3); font-size: .9rem; padding: 12px 0; }

/* ── Timer / projection (résultats) ── */
.pv11-timer { font-family: var(--mono); font-size: 1.1rem; color: var(--txt); }
.pv11-timer--urgent { color: var(--badge-new); }
.pv11-timer--done { color: var(--txt-3); }
.pv11-projection { font-family: var(--mono); font-size: .85rem; color: var(--txt-2); }
.pv11-tbtn { cursor: pointer; border: 1px solid var(--line-2); border-radius: var(--radius2); padding: 4px 8px; font-size: .78rem; color: var(--txt); min-width: 56px; }
.pv11-tbtn:hover { border-color: var(--accent); }

/* ── Présence (live/gaming) ── */
.pv11-presence { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius2); background: var(--panel); }
.pv11-presence__label { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-3); }
.pv11-presence__chip { font-size: .78rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--txt-2); }
.pv11-sync { font-family: var(--mono); font-size: .68rem; color: var(--success); margin-left: 8px; animation: pv11-pulse 1.2s ease; }
@keyframes pv11-pulse { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: .6; } }

/* ── Stats ── */
.pv11-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pv11-stat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px; text-align: center; }
.pv11-stat__num { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); }
.pv11-stat__label { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-3); margin-top: 4px; }

/* Podium */
.pv11-podium { display: flex; gap: 16px; align-items: flex-end; justify-content: center; min-height: 150px; flex-wrap: wrap; }
.pv11-podium__col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 140px; }
.pv11-podium__name { font-size: .82rem; text-align: center; color: var(--txt); }
.pv11-podium__bar { width: 70px; border-radius: var(--radius2) var(--radius2) 0 0; opacity: .85; }

/* Radars */
.pv11-radar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pv11-radar-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px; }
.pv11-radar-card__name { font-family: var(--font-display); font-size: .9rem; text-align: center; margin-bottom: 6px; color: var(--txt); }

@media (max-width: 640px) {
  .pv11-roster-row { grid-template-columns: 24px 1fr; }
  .pv11-roster-row__faction { grid-column: 2; }
}
