.bx-explorer {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  min-width: 0;
  overflow: clip;
}
.bx-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
}
.bx-overview h2 {
  font-size: 18px;
  line-height: 1.4;
}
.bx-overview p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.bx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.bx-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
}
.bx-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.bx-status-live {
  color: var(--cyan);
}
.bx-status-ready {
  color: var(--good);
}
.bx-status-completed {
  color: var(--gold);
}
.bx-legend b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bx-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 0 24px 18px;
}
.bx-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}
.bx-search {
  flex: 1;
  max-width: 390px;
}
.bx-search-input {
  position: relative;
  display: block;
}
.bx-search input {
  padding-right: 42px;
}
.bx-search-input button {
  position: absolute;
  right: 3px;
  top: 3px;
  padding: 0;
  width: 36px;
  min-height: 36px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.bx-round-select {
  min-width: 180px !important;
}
.bx-toolbar input,
.bx-toolbar select {
  min-height: 44px;
  font-size: 13px;
}
.bx-broadcast-button {
  min-height: 44px;
  margin-left: auto;
  white-space: nowrap;
}
.bx-round-nav {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.bx-round-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 48px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
}
.bx-round-nav button:hover {
  color: var(--ink);
  background: var(--raised);
}
.bx-round-nav button[aria-pressed="true"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.bx-round-nav button span {
  font-size: 10px;
  color: var(--muted);
  background: var(--raised);
  border-radius: 3px;
  padding: 0 5px;
}
.bx-round-nav button:focus-visible {
  outline-offset: -4px;
}
.bx-tree-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}
.bx-tree-help p {
  color: var(--muted);
  font-size: 12px;
}
.bx-tree-help button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  min-height: 36px;
  padding: 4px 0;
  font-size: 12px;
  flex-shrink: 0;
}
.bx-content {
  min-width: 0;
}
.bx-tree-scroll {
  max-height: 650px;
  max-height: min(650px, 68vh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 20px 12px;
  background: var(--bg);
}
.bx-tree {
  position: relative;
  width: calc(var(--bx-round-count) * 268px - 40px);
}
/* Fixed external geometry keeps style-src 'self' effective. Brackets are
   padded to a power of two, from 2 teams / 1 round to 256 teams / 8 rounds. */
.bx-tree[data-rounds="1"] {
  --bx-round-count: 1;
  --bx-row-count: 1;
}
.bx-tree[data-rounds="2"] {
  --bx-round-count: 2;
  --bx-row-count: 2;
}
.bx-tree[data-rounds="3"] {
  --bx-round-count: 3;
  --bx-row-count: 4;
}
.bx-tree[data-rounds="4"] {
  --bx-round-count: 4;
  --bx-row-count: 8;
}
.bx-tree[data-rounds="5"] {
  --bx-round-count: 5;
  --bx-row-count: 16;
}
.bx-tree[data-rounds="6"] {
  --bx-round-count: 6;
  --bx-row-count: 32;
}
.bx-tree[data-rounds="7"] {
  --bx-round-count: 7;
  --bx-row-count: 64;
}
.bx-tree[data-rounds="8"] {
  --bx-round-count: 8;
  --bx-row-count: 128;
}
.bx-tree-head {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 228px;
  gap: 40px;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 0;
  background: var(--bg);
}
.bx-tree-head button {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 3px 0;
  border: 0;
  background: var(--bg);
  border-radius: 0;
  min-height: 40px;
}
.bx-tree-head button span {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}
.bx-tree-head button small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.bx-tree-head button:hover span {
  color: var(--cyan);
}
.bx-tree-body {
  position: relative;
  height: calc(var(--bx-row-count) * 152px);
}
.bx-tree-column {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--bx-column) * 268px);
  width: 228px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.bx-tree-column[data-round="0"] {
  --bx-column: 0;
}
.bx-tree-column[data-round="1"] {
  --bx-column: 1;
}
.bx-tree-column[data-round="2"] {
  --bx-column: 2;
}
.bx-tree-column[data-round="3"] {
  --bx-column: 3;
}
.bx-tree-column[data-round="4"] {
  --bx-column: 4;
}
.bx-tree-column[data-round="5"] {
  --bx-column: 5;
}
.bx-tree-column[data-round="6"] {
  --bx-column: 6;
}
.bx-tree-column[data-round="7"] {
  --bx-column: 7;
}
.bx-tree-column .bx-match {
  flex: 0 0 132px;
}
.bx-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.bx-connectors path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}
.bx-match {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 132px;
  margin: 0;
  padding: 10px 12px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-weight: 500;
  line-height: 1.4;
  min-width: 0;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}
button.bx-match:hover {
  background: var(--raised);
  border-color: var(--cyan);
}
button.bx-match:active {
  background: var(--panel);
}
.bx-match.bx-live {
  border-color: var(--cyan);
}
.bx-match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
}
.bx-match-meta > strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.bx-match-meta .bx-status {
  font-size: 10px;
}
.bx-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 30px;
}
.bx-team-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.bx-team-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.bx-team .team-mark,
.bx-team .bx-placeholder {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 4px;
  object-fit: contain;
  font-size: 8px;
  background: var(--raised);
  color: var(--ink);
  border: 0;
  padding: 0;
}
.bx-team .bx-placeholder {
  color: var(--muted);
}
.bx-score {
  flex-shrink: 0;
  min-width: 18px;
  text-align: right;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.bx-winner {
  color: var(--gold);
  font-weight: 700;
}
.bx-unassigned {
  color: var(--muted);
}
.bx-unassigned .bx-team-name > span:last-child {
  font-size: 11px;
}
.bx-match-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--line);
}
.bx-match-foot > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bx-open {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.bx-round-list {
  padding: 18px 24px 24px;
}
.bx-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bx-list-heading h3 {
  font-size: 14px;
}
.bx-list-heading > span {
  font-size: 12px;
  color: var(--muted);
}
.bx-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
}
.bx-round-list + .bx-round-list {
  border-top: 1px solid var(--line);
}
.bx-bronze {
  border-top: 1px solid var(--line);
}
.bx-bronze .bx-match-grid {
  max-width: 320px;
}
.bx-result-count {
  padding: 18px 24px 0;
  color: var(--muted);
  font-size: 12px;
}
.bx-empty {
  text-align: center;
  padding: 36px 24px;
}
.bx-empty p {
  margin: 8px auto 18px;
  color: var(--muted);
}
.bx-champion {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 18px 24px;
}
.bx-champion .team-mark {
  width: 42px;
  height: 42px;
}
.bx-champion div {
  display: grid;
  gap: 1px;
}
.bx-champion span {
  font-size: 12px;
  color: var(--muted);
}
.bx-champion strong {
  color: var(--gold);
  font-size: 18px;
}
.bx-mobile-rounds {
  display: none;
}
.bx-broadcast .bx-toolbar,
.bx-broadcast .bx-tree-help {
  display: none;
}
@media (max-width: 850px) {
  .bx-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .bx-broadcast-button {
    display: none;
  }
  .bx-search {
    max-width: none;
  }
}
@media (max-width: 600px) {
  .bx-overview {
    padding: 18px 16px 14px;
  }
  .bx-toolbar {
    padding: 0 16px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .bx-search {
    flex-basis: 100%;
  }
  .bx-round-select {
    width: 100%;
  }
  .bx-round-nav {
    padding: 0 8px;
  }
  .bx-overview h2 {
    font-size: 16px;
  }
  .bx-legend {
    gap: 7px 14px;
  }
  .bx-tree-help {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .bx-desktop-tree {
    display: none;
  }
  .bx-mobile-rounds {
    display: block;
  }
  .bx-round-list {
    padding: 18px 16px;
  }
  .bx-match-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .bx-match {
    height: 132px;
  }
  .bx-team-name > span:last-child {
    font-size: 13px;
  }
  .bx-result-count {
    padding: 16px 16px 0;
  }
  .bx-champion {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bx-match {
    transition: none;
  }
}
