.bracket {
  --match-h: 3.35rem;
  --gap: 0.4rem;
  --unit: calc(var(--match-h) + var(--gap));
  --wire: rgba(200,243,29,0.5);
  --wire-w: 12px;
  --ink: #071018;
  --line: rgba(255,255,255,0.08);
  --lime: #C8F31D;
  --on: #F4F7F2;
  --muted: #8FA3B0;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.2rem 0.7rem 1.1rem;
  margin-top: 0.2rem;
}
.bracket::-webkit-scrollbar { height: 6px; }
.bracket::-webkit-scrollbar-thumb { background: #26384A; border-radius: 99px; }
.col, .wires {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.col {
  flex: 0 0 clamp(6.6rem, 28vw, 10.75rem);
}
.bracket[data-wired][data-rounds="2"] .col {
  flex: 0 0 calc((100% - var(--wire-w)) / 2);
}
.bracket[data-wired][data-rounds="3"] .col {
  flex: 0 0 calc((100% - 2 * var(--wire-w)) / 3);
}
.bracket[data-wired][data-rounds="4"] .col {
  flex: 0 0 calc((100% - 3 * var(--wire-w)) / 4);
}
.bracket:not([data-wired]) .col {
  flex: 0 0 min(86vw, 19.5rem);
}
.col-h {
  height: 1.25rem;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.3rem 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-body { flex: 1; display: flex; flex-direction: column; }
.slot {
  height: calc(var(--unit) * var(--span, 1));
  display: flex;
  align-items: center;
}
.wires { flex: 0 0 var(--wire-w); }
.wires .col-h { visibility: hidden; }
.fork { flex: 1; position: relative; }
.fork::before, .fork::after {
  content: "";
  position: absolute;
  left: 0; width: 100%;
  height: 2px;
  background: var(--wire);
}
.fork::before { top: 25%; }
.fork::after { bottom: 25%; }
.fork i {
  position: absolute;
  top: 25%; bottom: 25%;
  right: 0;
  width: 2px;
  background: var(--wire);
}
.match {
  width: 100%;
  height: var(--match-h);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1A2C3C 0%, #101D2A 100%);
  border: 1px solid rgba(200,243,29,0.12);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.06);
}
.match.soon { opacity: 0.92; }
.row {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 0;
  padding: 0 0.28rem 0 0.38rem;
  gap: 0.25rem;
}
.row + .row { border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.av { display: none; }
.stack { min-width: 0; }
.stack div {
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stack.win div { color: var(--lime); }
.stack.lose div, .stack.tbd div { color: var(--muted); font-weight: 600; }
.scores { display: flex; align-items: center; gap: 0.12rem; flex-shrink: 0; }
.cell {
  min-width: 1.05rem;
  padding: 0 0.12rem;
  height: 1.2rem;
  display: grid; place-items: center;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 0.68rem;
  color: var(--on);
  background: #0A141C;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09);
}
.cell.win { background: var(--lime); color: var(--ink); }
.cell.lose { color: var(--muted); }
.cell.pending { color: #5E7382; font-weight: 650; }
@media (min-width: 840px) {
  .bracket {
    --match-h: 3.85rem;
    --gap: 0.7rem;
    --wire-w: 28px;
    justify-content: flex-start;
    padding: 0.5rem 2rem 1.5rem;
  }
  .col,
  .bracket[data-wired][data-rounds="2"] .col,
  .bracket[data-wired][data-rounds="3"] .col,
  .bracket[data-wired][data-rounds="4"] .col {
    flex: 0 0 13.25rem;
    min-width: 0;
    max-width: none;
  }
  .bracket:not([data-wired]) .col { flex: 0 0 min(22rem, 32vw); max-width: none; }
  .col-h { height: 1.4rem; font-size: 0.7rem; margin-bottom: 0.45rem; }
  .av {
    display: grid; place-items: center;
    width: 1.5rem; height: 1.5rem; flex: 0 0 auto;
    border-radius: 50%;
    font-size: 0.5rem; font-weight: 800; letter-spacing: 0.03em;
    background: #0A141C; color: var(--on);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  }
  .av.win { background: var(--lime); color: var(--ink); }
  .av.lose, .av.tbd { color: var(--muted); }
  .stack div { font-size: 0.82rem; }
  .cell { min-width: 1.35rem; height: 1.55rem; font-size: 0.82rem; }
}
