/* Mi plantilla: capa premium (cancha, cajas, marcas de color, resumen, ventana emergente) */

/* Cancha ------------------------------------------------------------- */
.pitchContainer { padding: 10px; border: 0; background: #0F4130; box-shadow: 0 18px 40px rgba(15, 65, 48, .22); border-radius: 18px; }
.pitch.horizontal {
  border-radius: 12px; min-height: 560px; background-color: #2D7A56;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 5%, rgba(255,255,255,.045) 5% 10%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 105 68' preserveAspectRatio='none' fill='none' stroke='%23ffffff' stroke-opacity='0.62' stroke-width='0.4'%3E%3Cpath d='M52.5 0v68M0 0h105v68H0V0z'/%3E%3Ccircle cx='52.5' cy='34' r='9.15'/%3E%3Cpath d='M0 13.84h16.5v40.32H0M0 24.84h5.5v18.32H0M105 13.84H88.5v40.32h16.5M105 24.84h-5.5v18.32h5.5'/%3E%3Cpath d='M16.5 25.32a9.15 9.15 0 0 1 0 17.36M88.5 25.32a9.15 9.15 0 0 0 0 17.36'/%3E%3Ccircle cx='11' cy='34' r='0.4' fill='%23ffffff' fill-opacity='0.7'/%3E%3Ccircle cx='94' cy='34' r='0.4' fill='%23ffffff' fill-opacity='0.7'/%3E%3Ccircle cx='52.5' cy='34' r='0.4' fill='%23ffffff' fill-opacity='0.7'/%3E%3C/svg%3E");
}

/* Cajas de posición */
.zone { width: clamp(132px, 21cqw, 214px); max-height: 108px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .97); box-shadow: 0 6px 18px rgba(8, 36, 26, .28); }
.zone:hover { box-shadow: 0 10px 24px rgba(8, 36, 26, .36); }
.zone.is-active { border: 0; box-shadow: 0 0 0 3px #E7B84B, 0 10px 24px rgba(8, 36, 26, .4); }
.zone::before { background: var(--brand); color: #fff; width: 18px; height: 18px; font-size: 10px; }
.zones.is-editing .zone { border: 1px dashed var(--brand); }
.zoneList { padding: 6px 6px 6px 30px; gap: 4px; }
.zoneList:empty::after { content: "Tocá para asignar"; color: var(--ink-3); font-size: 11.5px; padding-top: 9px; }

/* Renglón de cada jugador */
.slot { position: relative; border-radius: 8px; background: var(--surface-2); padding: 4px 6px 4px 8px; transition: background .15s, opacity .15s, box-shadow .15s; box-shadow: inset 3px 0 0 transparent; }
.slot[data-color] { background: color-mix(in srgb, var(--slot-color) 15%, #fff); box-shadow: inset 3px 0 0 var(--slot-color); }
.slot:hover { background: var(--surface-3); }
.slot[data-color]:hover { background: color-mix(in srgb, var(--slot-color) 24%, #fff); }
.slotRank { border-radius: 5px; }
.slot[data-color] .slotRank { background: var(--slot-color); }
.slotName { font-weight: 600; }
.colBtn i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; display: block; transition: transform .15s; }
.colBtn:hover i { border-color: var(--brand); transform: scale(1.15); }
.slot[data-color] .colBtn i { background: var(--slot-color); border-color: var(--slot-color); }
.zones.has-highlight .slot.is-dim { opacity: .28; }

/* Barra de resumen y leyenda ------------------------------------------ */
.plx-bar { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.plx-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.plx-st { min-width: 128px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.plx-st b { font: 600 20px/1.1 var(--font-data); color: var(--ink); letter-spacing: -0.02em; }
.plx-st b small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.plx-st span { font-size: 11.5px; color: var(--ink-3); }
.plx-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.plx-key__t { font: 600 10.5px/1 var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.plx-k { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 500 12px/1 var(--font-ui); cursor: pointer; transition: all .15s; }
.plx-k i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.plx-k b { font: 600 11px/1 var(--font-data); color: var(--ink-3); }
.plx-k:hover { border-color: var(--c); }
.plx-k.is-on { background: color-mix(in srgb, var(--c) 16%, #fff); border-color: var(--c); color: var(--ink); }

/* Paleta */
.plx-pal { position: fixed; z-index: 10001; width: 200px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); }
.plx-pal[hidden], .plx-pop[hidden] { display: none; }
.plx-pal p { margin: 0 0 8px; font: 600 11px/1 var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.plx-pal__g { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.plx-sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; transition: transform .12s; padding: 0; }
.plx-sw:hover { transform: scale(1.18); }
.plx-pal__no { margin-top: 10px; width: 100%; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 500 12px/1 var(--font-ui); cursor: pointer; }
.plx-pal__no:hover { background: var(--surface-2); }

/* Ventana emergente del jugador */
.plx-pop { position: fixed; z-index: 10000; width: 292px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 18px 44px rgba(8, 36, 26, .3); pointer-events: none; animation: plxIn .14s ease-out; }
@keyframes plxIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.plx-pop__h { display: flex; align-items: center; gap: 11px; }
.plx-pop__ph { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.plx-pop__h > div { min-width: 0; flex: 1; }
.plx-pop__h b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.plx-pop__h span { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; color: var(--ink-2); }
.plx-pop__h small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.plx-pop__crest { width: 15px; height: 15px; object-fit: contain; }
.plx-pop__sc { font: 600 17px/1 var(--font-data); font-style: normal; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--brand); color: var(--brand-ink); flex: none; }
.plx-pop__g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.plx-pop__g > div { padding: 8px 6px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.plx-pop__g b { display: block; font: 600 16px/1.1 var(--font-data); color: var(--ink); }
.plx-pop__g span { font-size: 10.5px; color: var(--ink-3); }
.plx-pop__tag { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--ink); font: 600 11.5px/1 var(--font-ui); }
.plx-pop__tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.plx-pop__f { margin: 10px 0 0; font-size: 11px; color: var(--ink-3); }

/* Panel de búsqueda y encabezado --------------------------------------- */
.searchSidebar { border-radius: 18px; box-shadow: 0 10px 28px rgba(17, 28, 22, .08); }
.plantillaHeader .page-head__text .display { letter-spacing: -0.02em; }
.resultItem { border-radius: 12px; }
.resultItem:hover { background: var(--brand-tint); border-color: var(--brand-tint-2); }

@media (max-width: 900px) { .plx-st { min-width: 0; flex: 1 1 130px; } .plx-pop { display: none; } }
@media (prefers-reduced-motion: reduce) { .plx-pop { animation: none; } }

/* Los botones aparecen solo al pasar el mouse, así el nombre del jugador usa todo el ancho */
.zone { width: clamp(150px, 23cqw, 236px); }
.slot { padding-right: 8px; }
.slotBtns { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: none; align-items: center; gap: 1px; padding: 2px 3px; border-radius: 8px; background: #fff; box-shadow: 0 2px 8px rgba(17, 28, 22, .22); }
.slot:hover .slotBtns { display: flex; }
.slot .slotName { padding-right: 2px; }
.slot[data-color]::after { content: ""; position: absolute; right: 7px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--slot-color); }
.slot[data-color]:hover::after { display: none; }

/* ===== Parte 2: arrastrar, notas, comparar, compartir, exportar ===== */
.zone { overflow: visible; }
.zoneList { border-radius: 12px; }
.zone::before { content: attr(data-pos); width: 18px; height: auto; padding: 7px 0; border-radius: 9px; writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg); font: 600 9px/1 var(--font-data); letter-spacing: .1em; }
.slot[draggable="true"] { cursor: grab; }
.slot.is-drag { opacity: .4; }
.slot.drop-before { box-shadow: 0 -3px 0 #E7B84B, inset 3px 0 0 transparent; }
.zoneList.drop-end { box-shadow: inset 0 -3px 0 #E7B84B; }
.zone.is-over { box-shadow: 0 0 0 3px rgba(231, 184, 75, .85), 0 10px 24px rgba(8, 36, 26, .4); }
.noteBtn { font-size: 11px; }
.slot[data-note] .slotName::after { content: " ✎"; color: var(--brand); font-size: 10px; }

.zoneCmp { position: absolute; left: 50%; top: calc(100% - 3px); transform: translateX(-50%); display: none; height: 24px; padding: 0 11px; border: 0; border-radius: 99px; background: var(--brand); color: #fff; font: 600 11px/1 var(--font-ui); cursor: pointer; white-space: nowrap; box-shadow: 0 4px 10px rgba(8, 36, 26, .35); z-index: 3; }
.zoneCmp:hover { background: var(--brand-hover); }
.zone:has(.slot + .slot):hover .zoneCmp { display: block; }
.zones.is-editing .zoneCmp { display: none !important; }

/* Aviso */
.plx-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); z-index: 10020; max-width: min(440px, 92vw); padding: 11px 18px; border-radius: 12px; background: #0F2D22; color: #fff; font: 500 13px/1.4 var(--font-ui); box-shadow: 0 12px 28px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.plx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Nota */
.plx-note { position: fixed; z-index: 10002; width: 260px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); }
.plx-note[hidden] { display: none; }
.plx-note p { margin: 0 0 8px; font: 600 11px/1 var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.plx-note textarea { width: 100%; resize: none; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 10px; font: 400 13px/1.4 var(--font-ui); color: var(--ink); background: var(--surface); }
.plx-note textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.plx-note__b { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.plx-note__b > div { display: flex; gap: 6px; }
.plx-nbtn { height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 500 12px/1 var(--font-ui); cursor: pointer; }
.plx-nbtn--ok { background: var(--brand); border-color: var(--brand); color: #fff; }
.plx-pop__note { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #FBF4DC; color: #5C4300; font-size: 12px; line-height: 1.4; }
.plx-pop__note b { display: block; font: 600 10px/1 var(--font-data); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; color: #8F5E0F; }

/* Comparar */
body.plx-lock { overflow: hidden; }
.plx-cmp { position: fixed; inset: 0; z-index: 10010; background: rgba(17, 28, 22, .5); display: grid; place-items: center; padding: 16px; }
.plx-cmp[hidden] { display: none; }
.plx-cmp__card { position: relative; width: min(920px, 100%); max-height: 92vh; overflow: auto; padding: 24px 26px 20px; border-radius: 20px; background: var(--surface); box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.plx-cmp__card h3 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.plx-cmp__sub { margin: 4px 40px 14px 0; font-size: 13px; color: var(--ink-3); }
.plx-cmp__x { position: absolute; right: 16px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; }
.plx-cmp__x:hover { background: var(--surface-3); }
.plx-cmp__top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.plx-cmp__lg { display: flex; flex-direction: column; gap: 8px; }
.plx-lg { display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: 600 13.5px/1.2 var(--font-ui); color: var(--ink); cursor: pointer; transition: all .15s; }
.plx-lg i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); grid-row: 1 / 3; }
.plx-lg small { grid-column: 2; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.plx-lg:hover { border-color: var(--c); }
.plx-lg.is-off { opacity: .4; }
.plx-cmp__tip { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); }
.plx-r { width: 100%; height: auto; overflow: visible; }
.plx-r-ring { fill: none; stroke: #D3DED7; stroke-dasharray: 3 3; }
.plx-r-ring:last-of-type { stroke-dasharray: none; stroke: #9DBCAB; fill: #F5F9F6; }
.plx-r-spoke { stroke: #D3DED7; }
.plx-r-lbl { font: 400 9.5px var(--font-ui); fill: var(--ink-2); }
.plx-cmp__tw { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.plx-tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.plx-tb th, .plx-tb td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.plx-tb tbody tr:last-child th, .plx-tb tbody tr:last-child td { border-bottom: 0; }
.plx-tb th:first-child { text-align: left; font-weight: 500; color: var(--ink-2); }
.plx-tb thead th { font-weight: 600; color: var(--ink); background: var(--surface-2); }
.plx-tb thead th i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.plx-tb td { font-family: var(--font-data); }
.plx-tb td.is-best { color: var(--brand-ink); font-weight: 700; background: var(--brand-tint); }
.plx-cmp__f { margin: 10px 2px 0; font-size: 11.5px; color: var(--ink-3); }
.plx-cmp__ld { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 40px; color: var(--ink-3); }
@media (max-width: 760px) { .plx-cmp__top { grid-template-columns: 1fr; } .plx-cmp__card { padding: 18px 16px; } }

/* Imagen exportada: título y leyenda */
.plx-exp-head { position: absolute; left: 14px; right: 14px; top: 12px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 14px; background: rgba(15, 45, 34, .86); color: #fff; pointer-events: none; }
.plx-exp-head img { width: 30px; height: 30px; }
.plx-exp-head div { flex: 1; min-width: 0; }
.plx-exp-head b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.plx-exp-head span { font-size: 11.5px; opacity: .8; }
.plx-exp-head em { font-style: normal; font: 600 13px/1.2 var(--font-display); text-align: right; }
.plx-exp-head em small { display: block; font: 400 10px var(--font-ui); opacity: .75; }
.plx-exp-legend { position: absolute; left: 14px; bottom: 12px; z-index: 60; display: flex; flex-wrap: wrap; gap: 8px; padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, .94); pointer-events: none; }
.plx-exp-legend span { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1 var(--font-ui); color: var(--ink); }
.plx-exp-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.pitch.is-exporting .slotBtns, .pitch.is-exporting .zoneCmp { display: none !important; }

.plx-exp-head { padding: 6px 12px; }
.plx-exp-head img { width: 24px; height: 24px; }
.plx-exp-head b { font-size: 15px; }

/* ===== Primera B Nacional en Mi plantilla (SPM-05B2) ===== */
.plx-liga { display: inline-block; flex: none; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-3); font: 500 9.5px/1.55 var(--font-ui); white-space: nowrap; }
.plx-liga--bn { color: var(--brand); border-color: var(--brand-tint-2, #cfe3d8); background: var(--brand-tint, #EAF3EE); }
.slotTxt { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.slotTxt .slotName { flex: none; width: 100%; }
.slotName--off, .slotName--off:hover { cursor: default; color: var(--ink); text-decoration: none; }
.resultMeta .plx-liga { margin-left: 2px; }
.plx-pop__lg { margin-top: 6px; }
/* Rating (0 a 10) de la B Nacional: rotulado, en forma de pastilla (distinta del círculo del Puntaje). UI-05: el color del tramo de SU escala
   (fondo, borde y tinta) llega en línea desde ALAB_LIGA_METRICAS.pintar; lo mismo el Puntaje en .plx-pop__sc. Sin dato, queda neutro. */
.plx-pop__rt { font: 600 15px/1.1 var(--font-data); font-style: normal; min-width: 54px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); flex: none; }
.plx-pop__rt small { font: 400 9px/1.2 var(--font-ui); color: var(--ink-3); margin-top: 2px; }
.plx-pop__rt[style] small { color: inherit; opacity: .85; }
/* Exportar PNG: el texto de la fila con etiqueta de liga no se recorta al dibujarlo */
.pitch.is-exporting .slotTxt .slotName { overflow: visible; line-height: 1.5; }
.pitch.is-exporting .slotTxt .plx-liga { line-height: 1.7; margin-top: 2px; }
