/* Bracket Lab — dev demo for 32+ team horizontal brackets.
   Two variants share the lab shell; each variant lives in its own @layer
   so its specificity stays contained. */

@layer components {
  /* ============ Lab shell ============ */
  .bracket-lab {
    --bx-accent: var(--color-accent, #00e183);
    --bx-accent-soft: color-mix(in oklab, var(--bx-accent) 12%, transparent);
    /* Connectors + chrome usan grayscale puro — el accent verde queda
       reservado a estados explícitos (pill activa, ronda activa, step
       indicator). Antes el conjunto tenía demasiado verde difundido y
       el user reportó sensación "matrix". */
    --bx-line: color-mix(in oklab, var(--color-text-subtle, #71717a) 80%, transparent);
    --bx-surface-tie: var(--color-surface, #111113);
    --bx-surface-tbc: color-mix(in oklab, var(--color-surface-sunken, #16161a) 92%, var(--color-text-disabled, #52525b) 8%);

    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 16px 64px;
    min-height: 100vh;
    background: var(--color-surface, #111113);
    color: var(--color-text, #fff);
    font-family: var(--font-body, Manrope, sans-serif);
  }

  .bracket-lab__head {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1200px;
    margin-inline: auto;
    width: 100%;
  }

  .bracket-lab__eyebrow {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-subtle, #71717a);
    font-family: var(--font-body);
  }

  .bracket-lab__title h1 {
    font-family: var(--font-title, Oswald, sans-serif);
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 4px 0 6px;
  }

  .bracket-lab__title p {
    color: var(--color-text-muted, #a1a1aa);
    font-size: 14px;
    max-width: 560px;
    margin: 0;
  }

  .bracket-lab__switch {
    display: inline-flex;
    align-self: flex-start;
    background: var(--color-surface-sunken, #16161a);
    border: 1px solid var(--color-surface-border, rgb(255 255 255 / 8%));
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
  }

  .bracket-lab__switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font: inherit;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: color 160ms ease, background 200ms ease;
    min-height: 44px;
  }

  .bracket-lab__switch-btn:hover { color: var(--color-text); }
  .bracket-lab__switch-btn:focus-visible {
    outline: 2px solid var(--bx-accent);
    outline-offset: 2px;
  }

  .bracket-lab__switch-btn.active {
    background: var(--color-surface, #111113);
    color: var(--color-text);
    box-shadow: 0 0 0 1px var(--bx-accent-soft), inset 0 0 0 1px var(--bx-accent-soft);
  }

  .bracket-lab__switch-tag {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-family: var(--font-title);
    font-size: 12px;
    background: var(--bx-accent-soft);
    color: var(--bx-accent);
  }

  .bracket-lab__stage {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1400px;
    width: 100%;
    margin-inline: auto;
  }

  .bracket-lab__stage[hidden] { display: none; }

  .bracket-lab__caption {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    padding: 10px 14px;
    border-radius: var(--radius-md, 8px);
    background: var(--color-surface-sunken, #16161a);
    border-left: 2px solid var(--bx-accent);
  }

  .bracket-lab__caption-tag {
    font-family: var(--font-title);
    font-size: 13px;
    color: var(--bx-accent);
    letter-spacing: 0.04em;
  }

  .bracket-lab__caption-text {
    font-size: 13px;
    color: var(--color-text-muted);
  }

  /* ============ Variant A · Horizon ============ */
  .bx-horizon {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .bx-horizon__rail {
    --bx-col-width: clamp(220px, 32vw, 260px);
    --bx-tie-height: 80px;
    --bx-tie-gap: 10px;

    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--bx-col-width);
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    padding: 8px 4px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-border) transparent;
  }

  .bx-horizon__rail::-webkit-scrollbar { height: 6px; }
  .bx-horizon__rail::-webkit-scrollbar-thumb { background: var(--color-surface-border); border-radius: 3px; }

  .bx-col {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: var(--bx-tie-gap);
    position: relative;
    transition: opacity 220ms ease;
  }

  .bx-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-surface-sunken);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-surface-border);
  }

  .bx-col__label {
    font-family: var(--font-title);
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--color-text);
  }

  .bx-col__meta {
    font-size: 11px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--color-surface-active) 70%, transparent);
  }

  .bx-col--current .bx-col__head {
    border-color: var(--bx-accent-soft);
    box-shadow: 0 0 0 1px var(--bx-accent-soft), 0 0 24px -4px var(--bx-accent-soft);
  }

  .bx-col--current .bx-col__label { color: var(--bx-accent); }

  .bx-col__list {
    display: flex;
    flex-direction: column;
    gap: var(--bx-tie-gap);
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
  }

  .bx-tie {
    background: var(--bx-surface-tie);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: var(--bx-tie-height);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 220ms ease;
    cursor: pointer;
  }

  .bx-tie:hover,
  .bx-tie:focus-visible {
    border-color: var(--bx-accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 18px -6px color-mix(in oklab, var(--bx-accent) 28%, transparent);
  }

  .bx-tie--tbc {
    background: var(--bx-surface-tbc);
    border-style: dashed;
    border-color: color-mix(in oklab, var(--color-text-subtle) 40%, transparent);
  }

  .bx-tie__date {
    font-size: 10px;
    color: var(--color-text-subtle);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
  }

  .bx-tie__row {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
  }

  .bx-tie__crest {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-surface-sunken);
    color: var(--color-text-muted);
    font-size: 10px;
    border: 1px dashed var(--color-surface-border);
  }

  .bx-tie__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
  }

  .bx-tie__score {
    font-family: var(--font-title);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    min-width: 14px;
    text-align: right;
  }

  /* Connector gaps live between columns. Stretch the SVG vertically. */
  .bx-gap {
    color: var(--bx-line);
    opacity: 0.45;
    width: 22px;
    align-self: stretch;
    pointer-events: none;
  }

  .bx-gap__svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .bx-horizon__nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    padding-block: 6px;
  }

  .bx-horizon__nav-btn {
    border: 1px solid var(--color-surface-border);
    background: var(--color-surface-sunken);
    color: var(--color-text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    min-height: 36px;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
  }

  .bx-horizon__nav-btn:hover { color: var(--color-text); border-color: var(--bx-accent-soft); }
  .bx-horizon__nav-btn:focus-visible {
    outline: 2px solid var(--bx-accent);
    outline-offset: 2px;
  }

  .bx-horizon__nav-btn.active {
    color: var(--bx-accent);
    background: var(--bx-accent-soft);
    border-color: var(--bx-accent-soft);
  }

  /* ============ Variant B · Spotlight ============ */
  /* Variables redeclaradas en `.bx-spotlight` además del shell `.bracket-lab`
     porque el partial productivo (`pages/league/bracket/_spotlight.html.twig`)
     monta `.bx-spotlight` directamente sin el wrapper del lab — sin esta
     declaración local, el accent y el line color salen vacíos en producción
     y los activos se quedan sin color. */
  .bx-spotlight {
    --bx-spot-radius: 18px;
    --bx-accent: var(--color-accent, #00e183);
    --bx-accent-soft: color-mix(in oklab, var(--bx-accent) 12%, transparent);
    --bx-line: color-mix(in oklab, var(--color-text-subtle, #71717a) 80%, transparent);
    --bx-surface-tie: var(--color-surface, #111113);
    --bx-surface-tbc: color-mix(in oklab, var(--color-surface-sunken, #16161a) 92%, var(--color-text-disabled, #52525b) 8%);

    position: relative;
    display: grid;
    gap: 18px;
  }

  /* Cabecera de sub-torneo (Apertura/Clausura). Solo se pinta cuando la
     liga corre dos torneos en una misma temporada; el tab Eliminatorias
     monta un `.bx-spotlight` por torneo precedido de esta cabecera. En
     torneo único (UCL, copas) no se renderiza — el cuadro queda idéntico
     a la vista original. */
  .bx-tournament-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-block: 4px 0;
  }

  /* Apertura/Clausura toggle that switches between the two title brackets
     (replaces the old global phase conmutador on the Eliminatorias tab). */
  .bracket-tournaments-toggle {
    margin-bottom: 14px;
  }

  .bx-tournament-head__title {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(20px, 2.8vw, 26px);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--color-text);
  }

  /* Pills 1:1 con las cards del deck — same width, same scroll-padding,
     misma columna. Así la pill activa cae siempre encima del card
     visible sin desfase posible al hacer scroll. El JS controller
     sincroniza scrollLeft entre ambos containers. */
  .bx-spotlight__pills {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    padding: 4px 16px 12px;
    /* Igual que el deck: trailing room para anclar la última pill a la
       izquierda y mantener el mirror 1:1 de scrollLeft. */
    padding-inline-end: max(16px, calc(100% - clamp(260px, 30vw, 320px)));
    scrollbar-width: none;
    /* `contain` evita que un drag/scroll horizontal más allá del límite
       propague al body — sin esto el browser pinta el fondo dark del
       root mientras hace el bounce y las cards "parpadean a negro". */
    overscroll-behavior-x: contain;
  }
  .bx-spotlight__pills::-webkit-scrollbar { display: none; }

  .bx-spotlight__pill {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 clamp(260px, 30vw, 320px);
    scroll-snap-align: start;
    padding: 10px 14px;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-surface-border);
    border-radius: 14px;
    color: var(--color-text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    transition:
      color 320ms ease,
      border-color 320ms ease,
      transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 320ms ease;
  }

  /* Gradient highlight como overlay separado: los browsers no interpolan
     stops de un `background: linear-gradient(...)` entre estado normal y
     active, así que el switch sale brusco. Lo movemos a un ::after con
     opacity transition para que la "iluminación" sea un fade limpio y
     siga el scroll de las pills sin saltos. */
  .bx-spotlight__pill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bx-accent-soft), transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 360ms ease;
    z-index: 0;
  }

  .bx-spotlight__pill > * {
    position: relative;
    z-index: 1;
  }

  .bx-spotlight__pill:hover { color: var(--color-text); border-color: var(--bx-accent-soft); }
  .bx-spotlight__pill:focus-visible {
    outline: 2px solid var(--bx-accent);
    outline-offset: 2px;
  }

  .bx-spotlight__pill.active {
    color: var(--color-text);
    border-color: var(--bx-accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -10px color-mix(in oklab, var(--bx-accent) 50%, transparent);
  }

  .bx-spotlight__pill.active::after { opacity: 1; }

  /* Label fills the remaining row; long stage names get ellipsis
     instead of wrapping and breaking the fixed-width pill. */
  .bx-spotlight__pill-label {
    flex: 1 1 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
  }

  .bx-spotlight__pill-idx {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-family: var(--font-title);
    font-size: 12px;
    transition: background 360ms ease, color 360ms ease;
  }

  .bx-spotlight__pill.active .bx-spotlight__pill-idx {
    background: var(--bx-accent);
    color: var(--color-surface);
  }

  .bx-spotlight__pill-count {
    font-size: 11px;
    color: var(--color-text-subtle);
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--color-surface) 70%, transparent);
  }

  .bx-spotlight__deck {
    position: relative;
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    gap: 14px;
    padding: 12px 16px 32px;
    /* Trailing room = viewport menos un ancho de card, para que la ÚLTIMA
       ronda (Final) también pueda anclarse al borde izquierdo (spotlight).
       Sin esto el scroll se clampa y la Final queda a la derecha con la ronda
       previa ocupando el foco. Debe igualar el de `.bx-spotlight__pills`
       para no romper el mirror 1:1 de scrollLeft del controller. */
    padding-inline-end: max(16px, calc(100% - clamp(260px, 30vw, 320px)));
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-border) transparent;
    overscroll-behavior-x: contain;
  }
  .bx-spotlight__deck::-webkit-scrollbar { height: 6px; }
  .bx-spotlight__deck::-webkit-scrollbar-thumb {
    background: var(--color-surface-border);
    border-radius: 3px;
  }

  .bx-spot {
    flex: 0 0 clamp(260px, 30vw, 320px);
    scroll-snap-align: start;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--bx-spot-radius);
    padding: 18px;
    opacity: 0.72;
    transition: opacity 240ms ease, border-color 240ms ease, box-shadow 280ms ease;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .bx-spot--active {
    opacity: 1;
    border-color: color-mix(in oklab, var(--bx-accent) 45%, var(--color-surface-border));
    box-shadow:
      0 18px 50px -28px color-mix(in oklab, var(--bx-accent) 36%, transparent),
      0 0 0 1px var(--bx-accent-soft) inset;
  }

  .bx-spot__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-surface-border);
  }

  .bx-spot__step {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    font-family: var(--font-body);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .bx-spot--active .bx-spot__step { color: var(--bx-accent); }

  .bx-spot__title {
    font-family: var(--font-title);
    font-size: clamp(18px, 2.4vw, 22px);
    letter-spacing: -0.005em;
    margin: 0;
  }

  .bx-spot__count {
    font-size: 11px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
  }

  .bx-spot__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
  }

  .bx-spot-tie {
    background: var(--bx-surface-tie);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 220ms ease;
    cursor: pointer;
  }

  .bx-spot-tie:hover,
  .bx-spot-tie:focus-visible {
    transform: translateY(-1px);
    border-color: var(--bx-accent-soft);
    box-shadow: 0 4px 18px -6px color-mix(in oklab, var(--bx-accent) 28%, transparent);
  }

  .bx-spot-tie--tbc {
    background: var(--bx-surface-tbc);
    border-style: dashed;
    border-color: color-mix(in oklab, var(--color-text-subtle) 35%, transparent);
  }

  .bx-spot-tie__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .bx-spot-tie__date {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-subtle);
    font-variant-numeric: tabular-nums;
  }

  .bx-spot-tie__line {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
  }

  /* Loser line — tachado + atenuado. Solo se aplica cuando el tie está
     resuelto (winnerId presente) y este team no es el ganador. Para
     ties unfinished o placeholder ninguno lleva la clase. */
  .bx-spot-tie__line--lost .bx-spot-tie__name,
  .bx-spot-tie__line--lost .bx-spot-tie__score {
    color: var(--color-text-muted);
  }
  .bx-spot-tie__line--lost .bx-spot-tie__name {
    text-decoration: line-through;
  }

  .bx-spot-tie__crest {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-surface-sunken);
    color: var(--color-text-muted);
    font-size: 10px;
    border: 1px dashed var(--color-surface-border);
  }

  .bx-spot-tie__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bx-spot-tie__score {
    font-family: var(--font-title);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    min-width: 12px;
    text-align: right;
  }

  .bx-spot-tie__leg-tag {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--color-surface-active, rgba(255, 255, 255, 0.05));
  }

  /* Legs modal — bottom-sheet con backdrop. Reusa el patrón bottom-sheet
     del select-modal pero con scope local para no acoplar la dependencia. */
  .bx-legs-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 60%);
    backdrop-filter: blur(2px);
    z-index: 9998;
    animation: bx-legs-fade 200ms ease;
  }
  .bx-legs-backdrop[hidden] { display: none; }

  .bx-legs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    max-height: 70vh;
    background: var(--color-surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgb(0 0 0 / 40%);
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
    animation: bx-legs-slide 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .bx-legs[hidden] { display: none; }

  @media (min-width: 720px) {
    .bx-legs {
      left: 50%;
      right: auto;
      bottom: auto;
      top: 50%;
      transform: translate(-50%, -50%);
      max-width: 460px;
      width: 90vw;
      border-radius: 16px;
      animation: bx-legs-fade 200ms ease;
    }
  }

  @keyframes bx-legs-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  @keyframes bx-legs-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .bx-legs__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--color-surface-border);
    gap: 12px;
  }

  .bx-legs__title {
    margin: 0;
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bx-legs__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--color-surface-border);
    background: var(--color-surface-sunken);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 180ms ease;
  }
  .bx-legs__close:hover { border-color: var(--bx-accent-soft); }
  .bx-legs__close:focus-visible { outline: 2px solid var(--bx-accent); outline-offset: 2px; }

  .bx-legs__body {
    padding: 16px 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .bx-legs__agg {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px dashed var(--color-surface-border);
  }
  .bx-legs__agg strong {
    color: var(--bx-accent);
    font-family: var(--font-title);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    margin-left: 6px;
  }

  .bx-legs-leg {
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md, 8px);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  /* Leg clicable → link al partido (mismo intent que el modal del bracket
     simple). Reset de defaults de <a> + hover. */
  .bx-legs-leg--link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color 180ms ease, background 180ms ease;
  }

  .bx-legs-leg--link:hover,
  .bx-legs-leg--link:focus-visible {
    border-color: var(--bx-accent-soft);
    background: color-mix(in oklab, var(--bx-accent) 8%, var(--color-surface-sunken));
  }

  .bx-legs-leg__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--color-text-muted);
  }

  .bx-legs-leg__tag {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--color-text);
  }

  .bx-legs-leg__date { font-variant-numeric: tabular-nums; }

  .bx-legs-leg__venue {
    color: var(--color-text-subtle);
    font-size: 10px;
  }

  .bx-legs-leg__score {
    font-family: var(--font-title);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
  }
  .bx-legs-leg__dash { color: var(--color-text-subtle); font-weight: 400; }

  /* Bronze modifier — 3rd-place final. Sportmonks ships este partido
     como una stage paralela al Final con un único tie. En el bracket
     vertical legacy se descartaba del chain; aquí lo tratamos como una
     card más pero con identidad propia (acento dorado) para que el
     user lea "esto no fluye al ganador, es lateral". */
  .bx-spot--bronze {
    --bx-spot-accent: #d4a849;
    --bx-spot-accent-soft: color-mix(in oklab, #d4a849 12%, transparent);
  }

  .bx-spot--bronze.bx-spot--active {
    border-color: color-mix(in oklab, #d4a849 50%, var(--color-surface-border));
    box-shadow:
      0 18px 50px -28px color-mix(in oklab, #d4a849 36%, transparent),
      0 0 0 1px var(--bx-spot-accent-soft) inset;
  }

  .bx-spot--bronze.bx-spot--active .bx-spot__step {
    color: #d4a849;
  }

  .bx-spotlight__pill--bronze.active {
    background: linear-gradient(135deg, color-mix(in oklab, #d4a849 14%, transparent), transparent);
    border-color: #d4a849;
    box-shadow: 0 8px 24px -10px color-mix(in oklab, #d4a849 50%, transparent);
  }

  .bx-spotlight__pill--bronze.active .bx-spotlight__pill-idx {
    background: #d4a849;
    color: var(--color-surface);
  }

  /* ============ Reduced motion ============ */
  @media (prefers-reduced-motion: reduce) {
    .bx-tie, .bx-spot, .bx-spot-tie, .bx-spotlight__pill, .bracket-lab__switch-btn, .bx-spotlight__step-btn {
      transition: none;
    }
  }

  /* ============ Mobile tuning ============ */
  @media (max-width: 640px) {
    .bracket-lab { padding-inline: 12px; }
    .bx-horizon__rail { --bx-col-width: 78vw; }
    .bx-spot { padding: 18px; }
    .bx-spot__head { gap: 4px; }
    .bx-spotlight__step-btn { width: 40px; height: 40px; }
  }
}
