/*
 * Cuadros y clasificación de torneos (panel del club y página pública).
 *
 * Concepto: marcador de club. Carbón del logo y amarillo bola como único
 * acento; el estado del partido se lee por la tipografía y el marcador, no por
 * fondos de color. Todas las tarjetas de partido tienen la misma estructura
 * para que las líneas del cuadro casen.
 *
 * Todo cuelga de .pbx para no pisar el resto de estilos (Bootstrap incluido).
 * La tipografía se sirve desde el propio servidor (public/fonts/barlow), sin
 * llamadas externas.
 */
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow/barlow-condensed-700.woff2") format("woff2"); }

.pbx {
  --pbx-surface: #ffffff;
  --pbx-surface-2: #ebebe5;
  --pbx-ink: #22252a;
  --pbx-ink-2: #5d626b;
  --pbx-ink-3: #646972; /* 24/11/2026: antes #8b9099, que no llegaba al contraste mínimo en texto pequeño */
  --pbx-line: #d6d6cf;
  --pbx-ball: #d2dc16;
  --pbx-ball-ink: #22252a;
  --pbx-live: #d6342c;
  --pbx-gap: 34px;
  --pbx-text: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --pbx-cond: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  font-family: var(--pbx-text);
  font-size: 15px;
  line-height: 1.4;
  color: var(--pbx-ink);
}
.pbx *, .pbx *::before, .pbx *::after { box-sizing: border-box; }

/* ---------- Selectores (categoría, cuadro/consolación) ---------- */
.pbx-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pbx-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pbx-tab {
  font: 600 14px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--pbx-ink-2);
  background: transparent; border: 1.5px solid var(--pbx-line); border-radius: 4px; padding: 9px 12px; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.pbx-tab:hover { border-color: var(--pbx-ink-2); color: var(--pbx-ink); }
.pbx-tab.active { background: var(--pbx-ink); border-color: var(--pbx-ink); color: #fff; }
.pbx-seg { display: inline-flex; border: 1.5px solid var(--pbx-line); border-radius: 4px; overflow: hidden; }
.pbx-seg button {
  font: 600 14px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase;
  background: transparent; color: var(--pbx-ink-2); border: 0; padding: 9px 14px; cursor: pointer;
}
.pbx-seg button + button { border-left: 1.5px solid var(--pbx-line); }
.pbx-seg button.active { background: var(--pbx-ball); color: var(--pbx-ball-ink); }
.pbx-tab:focus-visible, .pbx-seg button:focus-visible, .pbx-tie[role="button"]:focus-visible { outline: 2px solid var(--pbx-ink); outline-offset: 2px; }
.pbx-label { font: 600 13px/1 var(--pbx-cond); letter-spacing: .09em; text-transform: uppercase; color: var(--pbx-ink-2); }

/* ---------- Cuadro ---------- */
.pbx-scroll { overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.pbx-bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(256px, 1fr); column-gap: var(--pbx-gap); min-width: max-content; }
.pbx-round { display: flex; flex-direction: column; scroll-snap-align: start; min-width: 0; }
.pbx-round-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 2px solid var(--pbx-ink); }
.pbx-round-head b { font: 700 19px/1 var(--pbx-cond); letter-spacing: .04em; text-transform: uppercase; }
.pbx-round-head span { font: 500 13px/1 var(--pbx-cond); letter-spacing: .05em; color: var(--pbx-ink-3); text-transform: uppercase; white-space: nowrap; }
.pbx-round-body { flex: 1; display: flex; flex-direction: column; }
.pbx-pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.pbx-slot { flex: 1; display: flex; align-items: center; padding: 7px 0; position: relative; min-width: 0; }
/* Conectores: cada partido sale a la derecha, la pareja de partidos se une y entra en el siguiente. */
.pbx-round:not(:last-child) .pbx-slot::after { content: ""; position: absolute; left: 100%; top: 50%; width: calc(var(--pbx-gap) / 2); border-top: 1.5px solid var(--pbx-line); }
.pbx-round:not(:last-child) .pbx-pair.has-two::after { content: ""; position: absolute; left: calc(100% + var(--pbx-gap) / 2); top: 25%; bottom: 25%; border-right: 1.5px solid var(--pbx-line); }
.pbx-round:not(:last-child) .pbx-pair:not(.has-two) .pbx-slot::after { width: var(--pbx-gap); }
.pbx-round:not(:first-child) .pbx-slot::before { content: ""; position: absolute; right: 100%; top: 50%; width: calc(var(--pbx-gap) / 2 - 1px); border-top: 1.5px solid var(--pbx-line); }

/* ---------- Tarjeta de partido ---------- */
.pbx-tie { width: 100%; min-width: 0; background: var(--pbx-surface); border: 1px solid var(--pbx-line); border-radius: 6px; overflow: hidden; text-align: left; }
.pbx-tie[role="button"] { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pbx-tie[role="button"]:hover { border-color: var(--pbx-ink-2); box-shadow: 0 4px 12px -8px rgba(34, 37, 42, .5); }
.pbx-tie-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 9px; min-height: 24px; background: var(--pbx-surface-2); font: 500 12.5px/1.2 var(--pbx-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--pbx-ink-2); }
.pbx-tie-meta > span { white-space: nowrap; }
.pbx-tie-meta .pbx-when b { color: var(--pbx-ink); font-weight: 700; margin-right: 2px; }
.pbx-tie-meta .pbx-where { overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--pbx-ink-3); }
.pbx-tie-meta .pbx-live { color: var(--pbx-live); font-weight: 700; }
.pbx-tie-meta .pbx-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pbx-live); margin-right: 5px; animation: pbx-pulse 1.4s ease-in-out infinite; }
@keyframes pbx-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pbx-tie-meta .pbx-live::before { animation: none; } }

.pbx-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 9px; height: 31px; }
.pbx-side + .pbx-side { border-top: 1px solid var(--pbx-line); }
.pbx-who { display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 500; color: var(--pbx-ink-2); }
.pbx-who > .pbx-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pbx-sets { display: flex; gap: 2px; font: 600 17px/1 var(--pbx-cond); font-variant-numeric: tabular-nums; color: var(--pbx-ink-3); }
.pbx-sets span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 3px; }
.pbx-side.win .pbx-who { color: var(--pbx-ink); font-weight: 700; }
.pbx-side.win .pbx-sets { color: var(--pbx-ink); }
.pbx-side.win .pbx-sets span.w { background: var(--pbx-ball); color: var(--pbx-ball-ink); }
.pbx-side.tbd .pbx-who { color: var(--pbx-ink-3); font-weight: 500; }
.pbx-tag { flex: none; font: 600 11.5px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--pbx-ink-2); border: 1px solid var(--pbx-line); border-radius: 3px; padding: 2px 4px; font-style: normal; }
.pbx-seed { flex: none; display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 3px; background: var(--pbx-ink); color: #fff; font: 700 12px/1 var(--pbx-cond); font-style: normal; }
.pbx-tie.is-final { border-color: var(--pbx-ink); }
.pbx-empty { padding: 22px 12px; text-align: center; color: var(--pbx-ink-2); border: 1px dashed var(--pbx-line); border-radius: 6px; }

.pbx-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 14px; font-size: 13px; color: var(--pbx-ink-2); }
.pbx-legend span { display: inline-flex; align-items: center; gap: 7px; }
.pbx-legend i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 3px; font: 600 13px/1 var(--pbx-cond); font-style: normal; }
.pbx-legend .l-w { background: var(--pbx-ball); color: var(--pbx-ball-ink); }
.pbx-legend .l-live { width: 8px; height: 8px; border-radius: 50%; background: var(--pbx-live); }
.pbx-legend .l-seed { background: var(--pbx-ink); color: #fff; }

/* ---------- Clasificación de liguilla ---------- */
.pbx-groups { display: flex; flex-direction: column; gap: 26px; margin-bottom: 22px; }
.pbx-group { border: 1px solid var(--pbx-line); border-radius: 8px; overflow: hidden; background: var(--pbx-surface); }
.pbx-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 14px 16px 10px; }
.pbx-group-head h3 { margin: 0; font: 700 22px/1 var(--pbx-cond); text-transform: uppercase; letter-spacing: .03em; color: var(--pbx-ink); }
.pbx-tscroll { overflow-x: auto; }
.pbx-table { width: 100%; min-width: 600px; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 0; }
.pbx-table th { font: 600 12.5px/1 var(--pbx-cond); letter-spacing: .09em; text-transform: uppercase; color: var(--pbx-ink-3); text-align: center; padding: 9px 8px; border-bottom: 2px solid var(--pbx-ink); white-space: nowrap; background: transparent; }
.pbx-table th.l, .pbx-table td.l { text-align: left; }
.pbx-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--pbx-line); color: var(--pbx-ink-2); background: transparent; }
.pbx-table tr:last-child td { border-bottom: 0; }
.pbx-table td.pos { width: 50px; padding-left: 16px; }
.pbx-table td.pos b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; font: 700 17px/1 var(--pbx-cond); color: var(--pbx-ink-2); background: var(--pbx-surface-2); }
.pbx-table tr.q td.pos b { background: var(--pbx-ball); color: var(--pbx-ball-ink); }
.pbx-table td.team { color: var(--pbx-ink); font-weight: 600; white-space: nowrap; }
.pbx-table td.pts { font: 700 19px/1 var(--pbx-cond); color: var(--pbx-ink); }
.pbx-table td.dif { font-weight: 600; color: var(--pbx-ink); }
.pbx-table tr.cut td { border-bottom: 2px dashed var(--pbx-ink-3); }
.pbx-form { display: inline-flex; gap: 4px; }
.pbx-form i { width: 18px; height: 18px; border-radius: 3px; display: grid; place-items: center; font: 700 11px/1 var(--pbx-cond); font-style: normal; background: var(--pbx-surface-2); color: var(--pbx-ink-3); }
.pbx-form i.g { background: var(--pbx-ink); color: #fff; }
.pbx-group-foot { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 10px 16px 14px; font-size: 13px; color: var(--pbx-ink-2); border-top: 1px solid var(--pbx-line); }
.pbx-group-foot b { color: var(--pbx-ink); }
.pbx-fixtures-title { padding: 12px 16px 0; }
.pbx-fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; padding: 10px 16px 16px; }

@media (max-width: 640px) {
  .pbx { --pbx-gap: 26px; }
  .pbx-bracket { grid-auto-columns: min(82vw, 262px); }
  .pbx-table td.pos { padding-left: 10px; }
  .pbx-group-head, .pbx-group-foot, .pbx-fixtures, .pbx-fixtures-title { padding-left: 12px; padding-right: 12px; }
}

/* Título de sección del panel de cuadros (fuera de .pbx). */
.pbx-h { font: 700 22px/1 "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .03em; color: #22252a; margin: 2rem 0 .9rem; padding-bottom: .5rem; border-bottom: 2px solid #22252a; }

/* ---------- Paneles, campos y botones (pestaña Disponibilidad) ---------- */
.pbx-disp { display: flex; flex-direction: column; gap: 18px; }
.pbx-panel { background: var(--pbx-surface); border: 1px solid var(--pbx-line); border-radius: 8px; padding: 16px 18px 18px; margin: 0; }
.pbx-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--pbx-ink); }
.pbx-panel-head h3 { margin: 0; font: 700 21px/1 var(--pbx-cond); text-transform: uppercase; letter-spacing: .03em; color: var(--pbx-ink); }
.pbx-note { margin: 0 0 12px; color: var(--pbx-ink-2); max-width: 62ch; }
.pbx-note b { color: var(--pbx-ink); }
.pbx-error { display: block; margin-top: 4px; font-size: 13px; color: var(--pbx-live); }

.pbx-btn {
  font: 600 14px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  background: var(--pbx-ink); color: #fff; border: 1.5px solid var(--pbx-ink); border-radius: 4px; padding: 10px 14px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .08s;
}
.pbx-btn:hover { background: #000; border-color: #000; }
.pbx-btn:active { transform: translateY(1px); }
.pbx-btn.ghost { background: transparent; color: var(--pbx-ink); border-color: var(--pbx-line); }
.pbx-btn.ghost:hover { border-color: var(--pbx-ink); background: transparent; }
.pbx-btn.small { padding: 7px 10px; font-size: 13px; }
.pbx-btn:focus-visible, .pbx-court:focus-visible, .pbx-input:focus-visible { outline: 2px solid var(--pbx-ink); outline-offset: 2px; }

.pbx-fields { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-start; }
.pbx-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 200px; max-width: 320px; margin: 0; }
.pbx-field > span { font: 600 12.5px/1.2 var(--pbx-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--pbx-ink-2); }
.pbx-field small { color: var(--pbx-ink-3); font-size: 12.5px; line-height: 1.35; }
.pbx-field-action { flex: 0 0 auto; padding-top: 20px; }
.pbx-input { width: 100%; height: 38px; padding: 0 10px; font: 500 15px/1 var(--pbx-text); color: var(--pbx-ink); background: var(--pbx-surface); border: 1.5px solid var(--pbx-line); border-radius: 4px; }
.pbx-input:hover { border-color: var(--pbx-ink-3); }

/* Pistas: se eligen pulsando. */
.pbx-courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; margin-bottom: 18px; }
.pbx-court { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; text-align: left; cursor: pointer;
  background: var(--pbx-surface); color: var(--pbx-ink-2); border: 1.5px solid var(--pbx-line); border-radius: 6px;
  font: 600 15px/1.2 var(--pbx-cond); letter-spacing: .04em; text-transform: uppercase; transition: border-color .15s, color .15s; }
.pbx-court i { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; border: 1.5px solid var(--pbx-line); font: 700 13px/1 var(--pbx-text); font-style: normal; color: var(--pbx-ball-ink); }
.pbx-court:hover { border-color: var(--pbx-ink-2); color: var(--pbx-ink); }
.pbx-court.on { border-color: var(--pbx-ink); color: var(--pbx-ink); }
.pbx-court.on i { background: var(--pbx-ball); border-color: var(--pbx-ball); }

/* Días de juego. */
.pbx-fields-days { margin-bottom: 14px; }
.pbx-fields-days .pbx-field { flex: 1 1 150px; max-width: 220px; }
.pbx-days { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pbx-line); }
.pbx-days li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 9px 2px; border-bottom: 1px solid var(--pbx-line); }
.pbx-days li b { font-weight: 600; min-width: 190px; }
.pbx-days li span { flex: 1; color: var(--pbx-ink-2); font-variant-numeric: tabular-nums; }

/* Rejilla de franjas por pista. */
.pbx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pbx-slots { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; margin: 0; }
.pbx-slots thead th { font: 600 12.5px/1.15 var(--pbx-cond); letter-spacing: .07em; text-transform: uppercase; color: var(--pbx-ink-2); text-align: center; padding: 4px 6px 8px; min-width: 96px; vertical-align: bottom; background: transparent; border: 0; }
.pbx-slots th.h { position: sticky; left: 0; z-index: 1; min-width: 58px; width: 58px; text-align: right; padding-right: 10px; background: var(--pbx-surface); font: 600 15px/1 var(--pbx-cond); letter-spacing: .02em; color: var(--pbx-ink-2); border: 0; }
.pbx-slots thead th.h { font-size: 12.5px; letter-spacing: .07em; }
.pbx-slots td { height: 30px; padding: 0; border: 0; border-radius: 4px; text-align: center; cursor: pointer; transition: background .12s, box-shadow .12s; }
.pbx-slots td span { font: 700 14px/1 var(--pbx-text); color: var(--pbx-ball-ink); }
.pbx-slots td.on { background: #e4ea6a; }
.pbx-slots td.on:hover { background: var(--pbx-ball); }
.pbx-slots td.off { background: var(--pbx-surface-2); }
.pbx-slots td:hover { box-shadow: inset 0 0 0 2px var(--pbx-ink); }
.pbx-slots tbody tr:hover th.h { color: var(--pbx-ink); }
.pbx-legend .l-off { background: var(--pbx-surface-2); }
.pbx-legend b { color: var(--pbx-ink); }

/* Incidencias. */
.pbx-incid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px 36px; align-items: start; }
.pbx-table-compact { min-width: 0; }
.pbx-table-compact td, .pbx-table-compact th { padding: 8px 6px; }

@media (max-width: 640px) {
  .pbx-panel { padding: 14px 12px 16px; }
  .pbx-field { max-width: none; }
  .pbx-field-action { padding-top: 0; width: 100%; }
  .pbx-days li b { min-width: 0; width: 100%; }
}

/* ---------- Pestaña Cuadros: barra de acciones y horario de partidos ---------- */
.pbx-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.pbx-chip { display: inline-flex; align-items: center; gap: 7px; font: 600 14px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase; padding: 11px 13px; border-radius: 4px; background: var(--pbx-surface-2); color: var(--pbx-ink); }
.pbx-btn i, .pbx-chip i { font-size: 12px; margin-right: 3px; }
.pbx-btn.accent { background: var(--pbx-ball); border-color: var(--pbx-ball); color: var(--pbx-ball-ink); }
.pbx-btn.accent:hover { background: #c2cc10; border-color: #c2cc10; }
.pbx-btn.ghost.danger { color: var(--pbx-live); }
.pbx-btn.ghost.danger:hover { border-color: var(--pbx-live); }

.pbx-sched-wrap { margin-bottom: 8px; }
.pbx-sched { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; margin: 0; }
.pbx-sched thead th { font: 600 12.5px/1.15 var(--pbx-cond); letter-spacing: .07em; text-transform: uppercase; color: var(--pbx-ink-2); text-align: center; padding: 4px 6px 8px; vertical-align: bottom; background: transparent; border: 0; }
.pbx-sched th.h { position: sticky; left: 0; z-index: 1; width: 58px; text-align: right; padding: 8px 10px 0 0; vertical-align: top; background: #f7f7f7; font: 600 15px/1 var(--pbx-cond); letter-spacing: .02em; color: var(--pbx-ink-2); border: 0; }
.pbx-sched thead th.h { font-size: 12.5px; letter-spacing: .07em; vertical-align: bottom; padding-bottom: 8px; }
.pbx-sched td.partido, .pbx-sched td.partido.categoria-resaltada { padding: 0; border: 0; background: transparent !important; box-shadow: none; vertical-align: top; height: 40px; }

.pbx-match { height: 100%; min-height: 86px; display: flex; flex-direction: column; gap: 3px; padding: 7px 9px 8px; text-align: left; cursor: pointer;
  background: var(--pbx-surface); border: 1px solid var(--pbx-line); border-radius: 6px; transition: border-color .15s, box-shadow .15s; }
.pbx-match:hover { border-color: var(--pbx-ink-2); box-shadow: 0 4px 12px -8px rgba(34, 37, 42, .5); }
.pbx-match-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.pbx-match-top b { font: 700 13.5px/1.1 var(--pbx-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--pbx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pbx-match-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font: 500 12px/1.2 var(--pbx-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--pbx-ink-3); margin-bottom: 3px; }
.pbx-match-sub > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pbx-num { flex: none; font: 600 12.5px/1 var(--pbx-cond); letter-spacing: .04em; color: var(--pbx-ink-3); }
.pbx-match-pair { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--pbx-ink); }
.pbx-match-pair span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pbx-match-pair i, .pbx-legend .l-in, .pbx-legend .l-out { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--pbx-ink-3); background: transparent; }
.pbx-match-pair i.in, .pbx-legend .l-in { background: var(--pbx-ball); border-color: var(--pbx-ink); }
.pbx-state { flex: none; font: 700 11.5px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--pbx-ink-3); white-space: nowrap; }
.pbx-state.live { color: var(--pbx-live); }
.pbx-state.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pbx-live); margin-right: 4px; animation: pbx-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pbx-state.live::before { animation: none; } }
.pbx-match.live { border-color: var(--pbx-live); }
.pbx-match.done { background: var(--pbx-surface-2); border-color: transparent; }
.pbx-match.done .pbx-match-pair, .pbx-match.done .pbx-match-top b { color: var(--pbx-ink-2); }
/* Partidos de la categoría elegida en el cuadro de abajo. */
.categoria-resaltada .pbx-match { border-color: var(--pbx-ink); background: #f8fadc; }
.categoria-resaltada .pbx-match.done { background: #eef0cf; border-color: var(--pbx-ink-2); }
.pbx-free { height: 100%; min-height: 40px; display: grid; place-items: center; border: 1.5px dashed var(--pbx-line); border-radius: 6px; font: 600 12.5px/1 var(--pbx-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--pbx-ink-3); }
.pbx-nores { height: 100%; min-height: 40px; border-radius: 6px; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(34, 37, 42, .06) 6px 7px); }
.pbx-legend .l-cat { background: #f8fadc; border: 1px solid var(--pbx-ink); }
.pbx-legend .l-free { background: transparent; border: 1.5px dashed var(--pbx-ink-3); }
.pbx-legend .l-nores { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(34, 37, 42, .25) 3px 4px); }
a.pbx-tab { display: inline-block; text-decoration: none; }
a.pbx-tab:hover { text-decoration: none; }
a.pbx-tab.active, a.pbx-tab.active:hover { color: #fff; }
/* Botones sueltos del panel que no cuelgan de un bloque .pbx. */
.pbx-btn.ghost { color: #22252a; border-color: #d6d6cf; }

/* ---------- Ventana de gestión del partido ---------- */
#matchModal .modal-dialog { max-width: 780px; }
#matchModal .modal-content.pbx-mm { width: 100% !important; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 10px; background: #fff !important; box-shadow: 0 24px 60px -20px rgba(34, 37, 42, .55); overflow: hidden; }
.pbx-mm-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 14px; border-bottom: 2px solid var(--pbx-ink); }
.pbx-mm-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pbx-mm-head h5 { margin: 0; font: 700 24px/1 var(--pbx-cond); text-transform: uppercase; letter-spacing: .02em; color: var(--pbx-ink); }
.pbx-mm-head .close { float: none; margin: 0; padding: 0 4px; font-size: 28px; line-height: 1; color: var(--pbx-ink-2); opacity: 1; background: transparent; border: 0; cursor: pointer; }
.pbx-mm-head .close:hover { color: var(--pbx-ink); }
.pbx-mm-chip { flex: none; font: 700 13px/1 var(--pbx-cond); letter-spacing: .07em; text-transform: uppercase; padding: 7px 10px; border-radius: 4px; background: var(--pbx-surface-2); color: var(--pbx-ink-2); white-space: nowrap; }
.pbx-mm-chip.live { background: transparent; color: var(--pbx-live); box-shadow: inset 0 0 0 1.5px var(--pbx-live); }
.pbx-mm-chip.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pbx-live); margin-right: 6px; animation: pbx-pulse 1.4s ease-in-out infinite; }
.pbx-mm-chip.done { background: var(--pbx-ink); color: #fff; }
.pbx-mm-chip.locked { background: transparent; color: var(--pbx-ink); box-shadow: inset 0 0 0 1.5px var(--pbx-ink); }
.pbx-mm .modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.pbx-mm-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pbx-mm-meta .pbx-btn { text-transform: none; letter-spacing: .02em; font-size: 15px; }
.pbx-mm-meta .pbx-btn.on { background: var(--pbx-ball); border-color: var(--pbx-ball); }
.pbx-mm-box { padding: 12px 14px; border-radius: 6px; background: var(--pbx-surface-2); }
.pbx-mm-box .hora-disponible { width: auto; margin: 0 6px 6px 0; padding: 8px 12px; border: 1.5px solid var(--pbx-line); border-radius: 4px; background: #fff; color: var(--pbx-ink); font: 600 15px/1 var(--pbx-cond); cursor: pointer; }
.pbx-mm-box .hora-disponible:hover { border-color: var(--pbx-ink); background: #fff; }

.pbx-mm-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: start; }
.pbx-mm-team { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--pbx-line); border-radius: 8px; min-width: 0; }
.pbx-mm-team.win { border-color: var(--pbx-ink); background: #f8fadc; }
.pbx-mm-team-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.pbx-mm-team-head .pbx-label { flex: 1; }
.pbx-mm-wintag { font: 700 12px/1 var(--pbx-cond); letter-spacing: .07em; text-transform: uppercase; padding: 4px 6px; border-radius: 3px; background: var(--pbx-ball); color: var(--pbx-ball-ink); }
.pbx-mm-x { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--pbx-ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.pbx-mm-x:hover { background: var(--pbx-surface-2); color: var(--pbx-live); }
.pbx-mm-names { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; font: 600 16px/1.3 var(--pbx-text); color: var(--pbx-ink); }
.pbx-mm-names:hover span { text-decoration: underline; text-decoration-color: var(--pbx-ink-3); }
.pbx-mm-names i { margin-left: 6px; font-size: 11px; color: var(--pbx-ink-3); }
.pbx-mm-empty { margin: 4px 0; color: var(--pbx-ink-3); }
.pbx-pres { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 4px; cursor: pointer;
  font: 600 14px/1 var(--pbx-cond); letter-spacing: .06em; text-transform: uppercase; background: transparent; border: 1.5px solid var(--pbx-line); color: var(--pbx-ink-2); }
.pbx-pres i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--pbx-ink-3); }
.pbx-pres.in { border-color: var(--pbx-ink); color: var(--pbx-ink); }
.pbx-pres.in i { background: var(--pbx-ball); border-color: var(--pbx-ink); }
.pbx-pres.wo { background: var(--pbx-ink); border-color: var(--pbx-ink); color: #fff; }
.pbx-pres.wo i { display: none; }
.pbx-pres:hover { border-color: var(--pbx-ink); }
.pbx-mm-incid { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pbx-link { padding: 2px 0; border: 0; background: transparent; cursor: pointer; font: 500 13.5px/1.3 var(--pbx-text); color: var(--pbx-ink-2); text-decoration: underline; text-decoration-color: var(--pbx-line); text-underline-offset: 3px; }
.pbx-link:hover { color: var(--pbx-ink); text-decoration-color: var(--pbx-ink); }
.pbx-link.danger:hover { color: var(--pbx-live); text-decoration-color: var(--pbx-live); }
.pbx-mm-manual { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--pbx-line); }
.pbx-mm-manual label { margin: 0; font-size: 14px; color: var(--pbx-ink); }
.pbx-mm-manual textarea.pbx-input, .pbx-mm-comment { height: auto; min-height: 64px; padding: 8px 10px; line-height: 1.4; resize: vertical; }
.pbx-mm-center { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 34px; min-width: 92px; }
.pbx-mm-vs { font: 700 26px/1 var(--pbx-cond); letter-spacing: .04em; color: var(--pbx-ink-3); }
.pbx-mm-time { font: 500 12.5px/1.2 var(--pbx-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--pbx-ink-3); text-align: center; }
.pbx-mm-time b { display: block; font-size: 15px; color: var(--pbx-ink); font-variant-numeric: tabular-nums; }

.pbx-mm-score { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 8px; background: var(--pbx-surface-2); }
.pbx-mm-score-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr); align-items: center; justify-items: center; gap: 14px; }
.pbx-mm-score-row > span { font: 600 13px/1 var(--pbx-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--pbx-ink-2); }
.pbx-mm-score-row.total > b { font: 700 40px/1 var(--pbx-cond); color: var(--pbx-ink); font-variant-numeric: tabular-nums; }
.pbx-step { display: flex; align-items: center; gap: 10px; }
.pbx-step b { min-width: 28px; text-align: center; font: 700 26px/1 var(--pbx-cond); color: var(--pbx-ink); font-variant-numeric: tabular-nums; }
.pbx-step button { width: 36px; height: 36px; border-radius: 4px; border: 1.5px solid var(--pbx-line); background: #fff; color: var(--pbx-ink); font: 600 20px/1 var(--pbx-text); cursor: pointer; transition: border-color .12s, transform .08s; }
.pbx-step button:hover { border-color: var(--pbx-ink); }
.pbx-step button:active { transform: translateY(1px); }
.pbx-step button:focus-visible, .pbx-pres:focus-visible, .pbx-link:focus-visible, .pbx-mm-x:focus-visible, .pbx-mm-names:focus-visible { outline: 2px solid var(--pbx-ink); outline-offset: 2px; }
.pbx-mm-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

@media (max-width: 640px) {
  .pbx-mm-teams { grid-template-columns: minmax(0, 1fr); }
  .pbx-mm-center { padding-top: 0; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pbx-mm-score-row { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); gap: 6px; }
  .pbx-step { gap: 6px; }
  .pbx-mm-foot .pbx-btn { flex: 1 1 100%; }
}

/* ---------- Disponibilidad: bloqueo de pistas y franjas (24/11/2026) ----------
   Cada motivo de bloqueo se distingue por tono y trama, sin salir de la paleta:
   clientes = carbón, clases = gris, sin uso = rayado, otro = borde discontinuo. */
.pbx-modo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.pbx-legend span.t { display: inline; }
.pbx-modo .pbx-seg { flex-wrap: wrap; }
.pbx-bloqueo { margin: 2px 0 16px; padding: 12px 14px; background: var(--pbx-surface-2); border-radius: 6px; align-items: end; }
.pbx-bloqueo .pbx-field-action { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 0; }
@media (min-width: 992px) { .pbx-bloqueo .pbx-field-action { flex-wrap: nowrap; } }
/* En pantallas estrechas la rejilla no se aplasta: se desplaza de lado dentro de su caja. */
.pbx-slots { min-width: calc(64px + var(--cols, 4) * 86px); }
.pbx-check { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; font-size: 14px; color: var(--pbx-ink); cursor: pointer; margin: 0; }
.pbx-check input { width: 17px; height: 17px; accent-color: var(--pbx-ink); margin: 0; }
.pbx-slots td.blk span { font: 600 11px/1 var(--pbx-cond); letter-spacing: .07em; text-transform: uppercase; }
.pbx-slots td.blk-clientes, .pbx-legend .blk-clientes { background: var(--pbx-ink); }
.pbx-slots td.blk-clientes span { color: #fff; }
.pbx-slots td.blk-clases, .pbx-legend .blk-clases { background: var(--pbx-ink-3); }
.pbx-slots td.blk-clases span { color: #fff; }
.pbx-slots td.blk-sin_uso, .pbx-legend .blk-sin_uso { background: var(--pbx-surface-2) repeating-linear-gradient(135deg, transparent 0 5px, rgba(34, 37, 42, .2) 5px 6px); }
.pbx-slots td.blk-sin_uso span { color: var(--pbx-ink-2); }
.pbx-slots td.blk-otro, .pbx-legend .blk-otro { background: var(--pbx-surface); box-shadow: inset 0 0 0 1.5px var(--pbx-ink-3); }
.pbx-slots td.blk-otro span { color: var(--pbx-ink-2); }
.pbx-slots td.blk:hover { box-shadow: inset 0 0 0 2px var(--pbx-ball); }
.pbx-slots td.blk-sin_uso:hover, .pbx-slots td.blk-otro:hover { box-shadow: inset 0 0 0 2px var(--pbx-ink); }
/* Franja con partido ya programado: esquina marcada (no se puede liberar ni bloquear). */
.pbx-slots td.con-partido, .pbx-legend .l-partido { background-image: linear-gradient(225deg, var(--pbx-ink) 0 7px, transparent 7px); }
@media (max-width: 640px) {
  .pbx-modo .pbx-seg { display: grid; grid-template-columns: 1fr; width: 100%; }
  .pbx-modo .pbx-seg button + button { border-left: 0; border-top: 1.5px solid var(--pbx-line); }
}

/* ---------- Accesibilidad (revisión 24/11/2026) ---------- */
.pbx-slots td > button { display: block; width: 100%; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.pbx-slots td > button:focus-visible { outline: 2px solid var(--pbx-ink); outline-offset: 2px; }
.pbx-slots td.blk-clientes > button:focus-visible { outline-color: var(--pbx-ball); outline-offset: -3px; }
.pbx-match:focus-visible { outline: 2px solid var(--pbx-ink); outline-offset: 2px; }
.pbf-overlay, .pbx-over { overscroll-behavior: contain; }
.pbx-mm-x { min-width: 28px; min-height: 28px; }
.pbx-mm-tel { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--pbx-ink-2); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.pbx-mm-tel:hover, .pbx-mm-tel:focus-visible { color: var(--pbx-ink); }
