/* =========================================================
   Comparateur d'armes (MJ) — pages/mj/MjWeaponComparator.jsx
   ========================================================= */

.wc-card { margin-bottom: 16px; }
.wc-card .card-header h3 { margin: 0; }
.wc-stack { display: flex; flex-direction: column; gap: 12px; }
.wc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px 16px; align-items: end; }
.wc-field { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-xs); color: var(--color-text-secondary); }
.wc-field .form-select, .wc-field .form-input { font-size: var(--text-sm); }
.wc-field.wc-row { flex-direction: row; }
.wc-hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.wc-strong { color: var(--color-text-primary); }
.wc-inline { display: flex; align-items: center; gap: 8px; }
.wc-wrap { flex-wrap: wrap; }

.wc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--color-border); border-radius: 999px; font-size: var(--text-xs); color: var(--color-text-primary); background: rgba(5, 10, 20, 0.6); }
.wc-chip button { background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1; }
.wc-chip button:hover, .wc-chip button:focus-visible { color: var(--color-text-bright); }
.wc-chip.is-ref { border-color: var(--color-border-active); }
.wc-ref-badge { font-size: var(--text-xs); }
.wc-swatch { display: inline-block; width: 10px; height: 10px; flex: none; }
.wc-size-picker { margin-top: 6px; }
.wc-size-btn { padding: 2px 8px; min-width: 0; }

.wc-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.wc-chart { margin: 0; }
.wc-chart-title { font-size: var(--text-sm); color: var(--color-text-primary); font-weight: 600; margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.wc-chart-desc { font-weight: 400; font-size: var(--text-xs); color: var(--color-text-secondary); }
.wc-chart-frame { position: relative; }
.wc-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.wc-chart svg:focus-visible { outline: 2px solid var(--color-border-active); outline-offset: 2px; }
.wc-axis { font-size: var(--text-xs); fill: var(--color-text-muted); font-family: var(--font-mono); }
.wc-axis-title { font-family: var(--font-primary); fill: var(--color-text-secondary); }
.wc-endlabel { font-size: var(--text-xs); fill: var(--color-text-primary); font-family: var(--font-mono); }
.wc-tooltip { position: absolute; top: 8px; pointer-events: none; background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: 6px; padding: 8px 10px; font-size: var(--text-xs); min-width: 180px; box-shadow: var(--shadow-md); z-index: 2; }
.wc-tooltip-title { color: var(--color-text-bright); font-weight: 600; margin-bottom: 4px; }
.wc-tooltip-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 6px; align-items: center; color: var(--color-text-secondary); }
.wc-tooltip-val { font-family: var(--font-mono); color: var(--color-text-primary); }
.wc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 8px; }
.wc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.wc-legend-line { width: 18px; height: 4px; flex: none; }

.wc-matrix-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.wc-matrix-legend { margin: 0; padding: 8px 16px; }
/* Largeur nulle + min 100 % : la table défile dans la carte au lieu d'élargir la page. */
.wc-matrix-scroll { padding: 0; max-height: 560px; overflow: auto; width: 0; min-width: 100%; }
.wc-matrix td, .wc-matrix th { white-space: nowrap; font-size: var(--text-xs); }
.wc-matrix .num { font-family: var(--font-mono); text-align: right; }
.wc-matrix tr.is-ref td { box-shadow: inset 0 1px 0 var(--color-border-active), inset 0 -1px 0 var(--color-border-active); }
/* Rapport à la référence : `tr:hover td` du thème bat une classe seule. */
.wc-matrix td.wc-better-1 { background: rgba(57, 135, 229, 0.18); }
.wc-matrix td.wc-better-2 { background: rgba(57, 135, 229, 0.36); }
.wc-matrix td.wc-better-3 { background: rgba(57, 135, 229, 0.56); }
.wc-matrix td.wc-worse-1 { background: rgba(230, 103, 103, 0.18); }
.wc-matrix td.wc-worse-2 { background: rgba(230, 103, 103, 0.36); }
.wc-matrix td.wc-worse-3 { background: rgba(230, 103, 103, 0.56); }

.wc-issues { margin: 0; padding-left: 18px; font-size: var(--text-xs); color: var(--color-text-secondary); display: flex; flex-direction: column; gap: 4px; }
.wc-issues code { color: var(--color-text-primary); }
.wc-note { font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.6; }
.wc-note code { color: var(--color-text-primary); }
.wc-flush { margin-top: 0; }
.wc-summary { cursor: pointer; }

@media (max-width: 640px) {
  .wc-charts { grid-template-columns: 1fr; }
}
