/* bracket.css — brackets de torneos, "Estilo B" (bloque): logo · nombre · resultado.
   Lo pinta includes/valorant/bracket-render.php (rb_bracket, rb_groups, rb_swiss).
   Todo va bajo .rb para no chocar con otras clases (.match, .team...). */
.rb {
    --rb-card: #1b1b1b; --rb-cell: #121212; --rb-line: #262626; --rb-line-2: #333;
    --rb-text: var(--text-white, #e8e8e8); --rb-muted: #8a8a8a; --rb-dim: #5a5a5a;
    --rb-teal: #207981; --rb-teal-hi: #2fb3be;
    --rb-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    --rb-gap: 28px; --rb-row: 38px; --rb-radius: 8px;
    color: var(--rb-text); font-size: 14px; line-height: 1.4;
}
.rb, .rb * { box-sizing: border-box; }
.rb-scroll { overflow-x: auto; padding-bottom: 4px; }
.rb-label { font: 11px var(--rb-mono); color: var(--rb-muted); letter-spacing: .08em; text-transform: uppercase; }
.rb-block-label { font: 11px var(--rb-mono); color: var(--rb-teal-hi); letter-spacing: .1em; text-transform: uppercase;
    padding: 0 0 12px; border-bottom: 1px solid var(--rb-line); margin-bottom: 16px; }
.rb-block + .rb-block { margin-top: 30px; }

/* Partido */
.rb-match { border: 1px solid var(--rb-line-2); background: var(--rb-card); width: 100%; border-radius: var(--rb-radius); overflow: hidden; }
.rb-team { display: flex; align-items: center; gap: 10px; height: var(--rb-row); padding-left: 10px; }
.rb-team + .rb-team { border-top: 1px solid var(--rb-line); }
.rb-ico { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 6px; overflow: hidden;
    background: linear-gradient(135deg, var(--valorant-red, #ff4655), #7a1d26); color: #fff; font: 800 8.5px var(--rb-mono); letter-spacing: -.02em; }
.rb-ico img { width: 100%; height: 100%; object-fit: cover; }
.rb-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-cell { align-self: stretch; width: 38px; flex: none; display: flex; align-items: center; justify-content: center;
    border-left: 1px solid var(--rb-line); background: var(--rb-cell); color: var(--rb-muted);
    font-family: var(--rb-mono); font-variant-numeric: tabular-nums; }
.rb-win .rb-name { font-weight: 600; }
.rb-win .rb-cell { background: var(--rb-teal); color: #fff; font-weight: 700; border-left-color: var(--rb-teal); }
.rb-lose .rb-name { color: var(--rb-muted); }
.rb-lose .rb-ico { opacity: .5; filter: grayscale(.6); }
.rb-tbd .rb-name { color: var(--rb-dim); }
.rb-tbd .rb-ico { background: var(--rb-cell); border: 1px dashed var(--rb-line-2); color: var(--rb-dim); }
.rb-me .rb-name { color: var(--rb-teal-hi); }

/* Eliminatorias */
.rb-bracket { display: flex; gap: var(--rb-gap); width: 100%; min-width: max-content; }
/* las rondas se estiran para ocupar el ancho disponible (mín. 200px; con scroll si no caben) */
.rb-round { display: flex; flex-direction: column; flex: 1 1 0; min-width: 200px; }
.rb-round:has(.rb-champ) { flex: 0 0 120px; min-width: 120px; }
.rb-round > .rb-label { height: 22px; margin-bottom: 10px; text-align: center; }
.rb-round-body { display: flex; flex-direction: column; }
.rb-group { flex: 1; display: flex; flex-direction: column; position: relative; }
.rb-slot { flex: 1; display: flex; align-items: center; position: relative; }
.rb-slot-wrap { width: 100%; }
.rb-link-pair .rb-group::after { content: ""; position: absolute; right: calc(var(--rb-gap) / -2); top: 25%; bottom: 25%;
    width: calc(var(--rb-gap) / 2); border: 1px solid var(--rb-line-2); border-left: 0; }
.rb-link-straight .rb-slot::after { content: ""; position: absolute; right: calc(var(--rb-gap) / -1); top: 50%;
    width: var(--rb-gap); border-top: 1px solid var(--rb-line-2); }
.rb-in .rb-slot::before { content: ""; position: absolute; left: calc(var(--rb-gap) / -2); top: 50%;
    width: calc(var(--rb-gap) / 2); border-top: 1px solid var(--rb-line-2); }
.rb-link-straight + .rb-in .rb-slot::before { display: none; }
.rb-note { font: 11px var(--rb-mono); color: var(--rb-dim); margin-top: 6px; }
.rb-gf .rb-match { border-color: var(--rb-teal); }
.rb-gf > .rb-label { color: var(--rb-teal-hi); }
.rb-champ { height: 76px; border-radius: var(--rb-radius); display: grid; place-items: center; border: 1px dashed var(--rb-teal); color: var(--rb-teal-hi); }
.rb-champ svg { width: 26px; height: 26px; }

/* Grupos (round robin) */
.rb-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 36px; }
.rb-table { border: 1px solid var(--rb-line-2); background: var(--rb-card); border-radius: var(--rb-radius); overflow: hidden; }
.rb-trow { display: flex; align-items: center; height: var(--rb-row); }
.rb-trow + .rb-trow { border-top: 1px solid var(--rb-line); }
.rb-trow.rb-head { height: 30px; background: #141414; }
.rb-trow.rb-head .rb-c { font: 11px var(--rb-mono); color: var(--rb-muted); letter-spacing: .06em; }
.rb-trow .rb-rank { width: 38px; align-self: stretch; display: flex; align-items: center; justify-content: center;
    font-family: var(--rb-mono); color: var(--rb-muted); border-right: 1px solid var(--rb-line); background: var(--rb-cell); }
.rb-trow.rb-head .rb-rank { background: none; border: 0; }
.rb-trow.rb-q .rb-rank { background: var(--rb-teal); color: #fff; font-weight: 700; border-right-color: var(--rb-teal); }
.rb-trow .rb-who { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 10px; min-width: 0; }
.rb-trow.rb-out .rb-name { color: var(--rb-muted); } .rb-trow.rb-out .rb-ico { opacity: .5; filter: grayscale(.6); }
.rb-trow .rb-c { width: 64px; text-align: center; font-family: var(--rb-mono); font-variant-numeric: tabular-nums; color: var(--rb-muted); }
.rb-trow .rb-c.rb-strong { color: var(--rb-text); font-weight: 600; }
.rb-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--rb-muted); }
.rb-sw { display: inline-block; width: 10px; height: 10px; background: var(--rb-teal); margin-right: 6px; vertical-align: -1px; }
.rb-sw.rb-g { background: var(--rb-cell); border: 1px solid var(--rb-line-2); }
.rb-gmatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 16px; }
.rb-gcol { display: flex; flex-direction: column; gap: 8px; }

/* Swiss */
.rb-swiss { display: flex; gap: var(--rb-gap); width: 100%; min-width: max-content; align-items: flex-start; }
.rb-scol > .rb-label { text-align: center; }
.rb-scol { flex: 1 1 0; min-width: 200px; display: flex; flex-direction: column; gap: 18px; }
.rb-pool { display: flex; flex-direction: column; gap: 8px; }
.rb-rec b { border-radius: 5px; font: 600 12px var(--rb-mono); color: var(--rb-text); border: 1px solid var(--rb-line-2); padding: 2px 6px; background: #141414; }
.rb-res .rb-team { border: 1px solid var(--rb-line-2); background: var(--rb-card); }
.rb-res .rb-team + .rb-team { border-top: 0; }
.rb-res .rb-team:first-of-type { border-radius: var(--rb-radius) var(--rb-radius) 0 0; }
.rb-res .rb-team:last-child { border-radius: 0 0 var(--rb-radius) var(--rb-radius); }
.rb-res .rb-team .rb-cell { border-radius: inherit; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.rb-res .rb-cell { width: 46px; }
.rb-res .rb-q .rb-cell { background: var(--rb-teal); color: #fff; font-weight: 700; border-left-color: var(--rb-teal); }
.rb-res .rb-e .rb-name { color: var(--rb-muted); } .rb-res .rb-e .rb-ico { opacity: .5; filter: grayscale(.6); }
.rb-res-title { font: 11px var(--rb-mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.rb-res-title.rb-q { color: var(--rb-teal-hi); } .rb-res-title.rb-e { color: var(--rb-muted); }
.rb-champ.has-win { flex-direction: column; gap: 6px; border-style: solid; border-color: #f0c419; background: rgba(240, 196, 25, .08); color: #f0c419; }
.rb-champ.has-win b { color: var(--text-white, #fff); font-size: 14px; text-align: center; padding: 0 8px; }

/* Hora de cada partido: etiqueta encima de su caja (sin mover la caja: las líneas del bracket siguen cuadrando) */
.rb-slot-wrap { position: relative; }
.rb-when { position: absolute; left: 10px; bottom: 100%; pointer-events: none; }
/* pestaña pegada a la caja: mismo fondo, sin borde abajo */
.rb-when-pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 9px; border-radius: 7px 7px 0 0; border-bottom: 0 !important;
    border: 1px solid var(--rb-line-2); background: var(--rb-card); color: var(--rb-text, #c7cdd6);
    font: 600 10.5px/1 var(--rb-mono); white-space: nowrap; }
.rb-when-pill svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; opacity: .75; }
.rb-when.is-done .rb-when-pill { opacity: .55; }
.rb-when.is-late .rb-when-pill { border-color: rgba(240,180,41,.45); background: #2a2414; color: #f5c451; }
.rb-when .rb-late { color: #f0b429; }
/* Liguilla y suizo (columnas sin líneas): la etiqueta va en su sitio, encima del partido */
.rb-gcol .rb-when, .rb-pool .rb-when { position: static; margin: 8px 0 0 10px; }
