/* ============================================================
   smgr · css/pages/viz_similares.css — DISEÑO de "Jugadores parecidos"
   (visualizacion_similares.php). La TARJETA capturable (radar + tabla) va
   scopeada bajo #captureArea; los CONTROLES (.sim-tools) y el tooltip del radar
   (#rpTip) viven FUERA del captureArea y se namespacean para no colisionar con
   el chrome "Foco". Sin `body{background}` ni reset global (los aporta viz.css).
   Ancho fijo 960px. Sin media query que reforme el captureArea (lo escala el
   escalador de viz.css).
   ============================================================ */

/* ---------- Controles (FUERA del captureArea) ---------- */
.sim-tools { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: var(--sp-4, 16px); }
.sim-tools .viz-controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; max-width: 960px; font-family: 'Inter', sans-serif; }
.sim-tools .viz-controls label { font-size: 12px; font-weight: 700; color: #2d3748; text-transform: uppercase; letter-spacing: .3px; }
.sim-tools .ctrl-group { display: flex; align-items: center; gap: 7px; }
.sim-tools .viz-controls select, .sim-tools .viz-controls input {
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; border: 1px solid #cbd5e1;
  background: #fff; color: #1f2937; cursor: pointer;
}
.sim-tools #searchInput { cursor: text; min-width: 240px; }
.sim-tools .ac-wrap { position: relative; }
.sim-tools .ac-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50; margin-top: 3px;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.18); display: none; max-height: 320px; overflow-y: auto;
}
.sim-tools .ac-item { padding: 8px 12px; font-size: 13px; color: #1f2937; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.sim-tools .ac-item:last-child { border-bottom: none; }
.sim-tools .ac-item:hover, .sim-tools .ac-item.active { background: #eef5ff; }
.sim-tools .seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.sim-tools .seg button {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
  padding: 8px 12px; border: none; background: #fff; color: #4b5563; cursor: pointer;
}
.sim-tools .seg button.active { background: #2c5282; color: #fff; }
.sim-tools .seg button:disabled { opacity: .4; cursor: not-allowed; }

/* visibilidad por modo */
.sim-tools .viz-controls[data-mode="compare"] .mode-similar { display: none; }
.sim-tools .viz-controls[data-mode="similar"] .mode-compare { display: none; }

/* chips de jugadores elegidos (modo comparar) */
.sim-tools .chip-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; max-width: 960px; }
.sim-tools .chip { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 700; color: #1f2937; font-family: 'Inter', sans-serif; }
.sim-tools .chip .chip-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.sim-tools .chip select { border: none; background: #eef2f7; border-radius: 12px; font-size: 12px; font-weight: 600;
  padding: 3px 6px; cursor: pointer; font-family: 'Inter', sans-serif; color: #1f2937; }
.sim-tools .chip .chip-x { border: none; background: none; color: #94a3b8; font-size: 17px; font-weight: 800;
  cursor: pointer; line-height: 1; padding: 0 3px; }
.sim-tools .chip .chip-x:hover { color: #ef4444; }
.sim-tools .chip-hint { font-size: 13px; color: #64748b; font-weight: 500; }

/* info (?) junto a las etiquetas de los controles */
.sim-tools .ctrl-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  background: #94a3b8; color: #fff; font-size: 10px; font-weight: 800;
  font-style: normal; cursor: help; position: relative; vertical-align: middle;
}
.sim-tools .ctrl-info .ctrl-pop {
  display: none; position: absolute; top: 23px; left: 50%; transform: translateX(-50%);
  width: 290px; background: rgba(15,23,42,0.98); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 10px 12px;
  font-size: 11.5px; font-weight: 500; line-height: 1.55; text-align: left;
  text-transform: none; letter-spacing: 0; z-index: 100; box-shadow: 0 12px 34px rgba(0,0,0,0.45);
}
.sim-tools .ctrl-info .ctrl-pop b { color: #f6ad55; }
.sim-tools .ctrl-info .ctrl-pop .o { color: #fff; font-weight: 700; }
.sim-tools .ctrl-info:hover .ctrl-pop, .sim-tools .ctrl-info:focus .ctrl-pop { display: block; }

/* ---------- Tarjeta capturable ---------- */
#captureArea {
  font-family: 'Inter', sans-serif;
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  overflow: hidden; width: 960px;
}
#captureArea * { box-sizing: border-box; }

#captureArea .header {
  background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
  color: #fff; padding: 14px 22px; display: flex; align-items: center; gap: 14px;
}
#captureArea .logo {
  width: 56px; height: 42px; background: #fff; border-radius: 15%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.3); overflow: hidden; flex-shrink: 0;
}
#captureArea .logo img { width: 100%; height: 100%; object-fit: contain; }
#captureArea .header h1 { font-size: 21px; font-weight: 800; line-height: 1.1; }
#captureArea .header p { font-size: 12px; opacity: 0.92; margin-top: 3px; }

/* --- panel del radar (oscuro) --- */
#captureArea .radar-panel {
  background: radial-gradient(circle at 50% 42%, #202a44 0%, #131a2e 75%);
  display: flex; align-items: center; gap: 6px; padding: 14px 18px 6px;
}
#captureArea .radar-svg-wrap { flex: 1 1 auto; min-width: 0; }
#captureArea .radar-svg-wrap svg { width: 100%; height: auto; display: block; }
#captureArea .radar-legend { flex: 0 0 230px; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
#captureArea .leg-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #e2e8f0; line-height: 1.15; }
#captureArea .leg-swatch { width: 22px; height: 0; border-top-width: 3px; border-top-style: solid; flex-shrink: 0; border-radius: 2px; }
#captureArea .leg-swatch.filled { height: 12px; border: none; border-radius: 3px; }
#captureArea .leg-name { font-weight: 700; }
#captureArea .leg-sub { color: #94a3b8; font-weight: 500; }
#captureArea .rp-hit { cursor: crosshair; }

/* --- tabla de detalle --- */
#captureArea .detail-note { background: #f8f9fa; padding: 8px 22px; border-bottom: 1px solid #e2e8f0; font-size: 11px; color: #4b5563; line-height: 1.5; }
#captureArea .detail-note b { color: #1f2937; }
#captureArea .sim-table { width: 100%; border-collapse: collapse; font-size: 12px; }
#captureArea .sim-table thead th {
  background: #2d3748; color: #fff; padding: 7px 6px; font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: .3px; text-align: right; white-space: nowrap;
}
#captureArea .sim-table thead th.l { text-align: left; }
#captureArea .sim-table tbody td { padding: 6px 6px; border-bottom: 1px solid #edf2f7; text-align: right; white-space: nowrap; color: #1f2937; }
#captureArea .sim-table tbody td.l { text-align: left; }
#captureArea .sim-table tbody tr:nth-child(even) { background: #f9fafb; }
#captureArea .sim-table tbody tr.is-target { background: #fff7ed; }
#captureArea .sim-table tbody tr.is-target td { font-weight: 800; }
#captureArea .pl-cell { display: flex; align-items: center; gap: 7px; }
#captureArea .pl-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
#captureArea .pl-shield { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
#captureArea .pl-name { font-weight: 700; }
#captureArea .sim-pct { font-weight: 800; color: #2c5282; }
#captureArea .pos-b { color: #2563eb; }
#captureArea .pos-a { color: #059669; }
#captureArea .pos-p { color: #b45309; }

/* matriz de similitud (modo comparar) */
#captureArea #simMatrix:empty { display: none; }
#captureArea .mx-title { padding: 12px 22px 6px; font-weight: 800; font-size: 11px; color: #2d3748;
  text-transform: uppercase; letter-spacing: .3px; border-top: 1px solid #e2e8f0; }
#captureArea .mx-title span { font-weight: 500; text-transform: none; letter-spacing: 0; color: #64748b; }
#captureArea .mx-scroll { overflow-x: auto; padding: 0 22px 14px; }
#captureArea .mx-table { border-collapse: collapse; font-size: 11px; }
#captureArea .mx-table th, #captureArea .mx-table td { border: 1px solid #e2e8f0; padding: 5px 9px; text-align: center; white-space: nowrap; }
#captureArea .mx-table thead th { background: #f8f9fa; font-weight: 700; color: #1f2937; }
#captureArea .mx-table .mx-rowlab { background: #f8f9fa; text-align: left; font-weight: 700; }
#captureArea .mx-table td { font-variant-numeric: tabular-nums; font-weight: 700; color: #1f2937; }
#captureArea .mx-table .mx-diag { background: #edf2f7; color: #94a3b8; font-weight: 400; }
#captureArea .mx-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
#captureArea .mx-sub { color: #94a3b8; font-weight: 500; margin-left: 3px; }

#captureArea .footer {
  background: #2d3748; color: #cbd5e1; padding: 9px 22px; font-size: 10.5px;
  display: flex; justify-content: space-between; align-items: center;
}
#captureArea .footer .social-links { display: flex; gap: 14px; }

/* ---------- Tooltip del radar (FUERA del captureArea, creado por JS) ---------- */
#rpTip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: rgba(15,23,42,0.97); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  padding: 8px 10px; font-family: 'Inter', sans-serif; font-size: 11px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.45); max-width: 300px;
}
#rpTip .rp-tip-h { font-weight: 800; font-size: 12px; margin-bottom: 5px; color: #f6ad55; }
#rpTip .rp-tip-r { display: flex; align-items: center; gap: 6px; line-height: 1.55; white-space: nowrap; }
#rpTip .rp-tip-sw { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
#rpTip .rp-tip-n { flex: 1; font-weight: 600; }
#rpTip .rp-tip-v { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 10px; }
