/* bracket.css — knockout (cup) bracket view.
   Responsive strategy: each round is a flex column with a fixed minimum
   width; on narrow screens the whole bracket scrolls horizontally. */

.bracket-scroll {
  overflow-x: auto;
  padding: 0.5rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.bracket {
  display: flex;
  gap: 44px;
  min-width: max-content;
  align-items: stretch;
}

.b-col {
  display: flex;
  flex-direction: column;
  min-width: 215px;
}

.b-round-title {
  text-align: center;
  color: var(--text-accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 2px;
  margin-bottom: 0.75rem;
}

.b-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 18px;
  flex: 1;
}

/* -------------------------------- match card ------------------------------ */

.b-match {
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  overflow: visible;
}

/* Connector stubs: incoming (left) for every round after the first,
   outgoing (right) for every round before the champion column. */
.b-col:not(:first-child) .b-match::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  width: 22px;
  height: 2px;
  background: var(--border-color);
}

.b-col:not(:last-child) .b-match::after {
  content: '';
  position: absolute;
  right: -24px;
  top: 50%;
  width: 22px;
  height: 2px;
  background: var(--border-color);
}

.b-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px 8px 0 0;
}

.b-team + .b-team {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
}

.b-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
}

.b-team.tbd .b-name {
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 400;
}

.b-team.winner {
  background: rgba(255, 215, 0, 0.1);
}

.b-team.winner .b-name {
  color: var(--text-neon);
}

.b-score-dash {
  color: var(--text-secondary);
  width: 44px;
  text-align: center;
}

.b-match .score-input {
  width: 44px;
}

/* ------------------------------- champion box ----------------------------- */

.b-champion {
  background: var(--card-bg);
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  padding: 1.1rem 0.9rem;
  text-align: center;
  font-size: 1.9rem;
  min-width: 170px;
}

.b-champion .b-champ-name {
  margin-top: 0.4rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
}

.b-champion.won {
  border-style: solid;
  border-color: #ffd700;
  box-shadow: 0 0 26px rgba(255, 215, 0, 0.4), inset 0 0 18px rgba(255, 215, 0, 0.08);
}

.b-champion.won .b-champ-name {
  color: var(--text-neon);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

/* ------------------------------- bronze final ----------------------------- */

.bronze-final {
  margin-top: 1.75rem;
  max-width: 300px;
}

.bronze-final .b-round-title {
  text-align: left;
}

/* Hint shown under the bracket on small screens. */
.bracket-swipe-hint {
  display: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .bracket-swipe-hint { display: block; }
  .b-col { min-width: 195px; }
}
