/* ── Scroll wrapper ─────────────────────────────────────── */
.bracket-scroll-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 0 2rem 0;
  cursor: grab;
  user-select: none;
  touch-action: none;        /* ← let JS handle all touch directions */
  max-height: 70vh;          /* ← gives the wrapper a vertical boundary to scroll within */
}
.bracket-scroll-wrapper:active { cursor: grabbing; }

/* ── Bracket stage ──────────────────────────────────────── */
.bracket-stage { position: relative; }

/* ── SVG connector layer ─────────────────────────────────── */
.bracket-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  overflow: visible;
}

/* ── Round label ─────────────────────────────────────────── */
.round-label {
  position: absolute;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-primary, #e06b2b);
  text-align: center;
  white-space: nowrap;
}

/* ── Match card ─────────────────────────────────────────── */
.bracket-match {
  position: absolute;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.bracket-match:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
  border-color: var(--color-primary, #e06b2b);
  z-index: 10;
}

/* ── Match meta line ─────────────────────────────────────── */
.match-meta {
  font-size: .65rem;
  color: #888;
  padding: .3rem .55rem .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid #2a2a2a;
}

/* ── Match notes ─────────────────────────────────────────── */
.match-notes {
  font-size: .65rem;
  color: #aaa;
  padding: 0 .55rem .25rem;
  font-style: italic;
}

/* ── Team rows ───────────────────────────────────────────── */
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .55rem;
  border-top: 1px solid #2a2a2a;
  gap: .4rem;
  min-height: 28px;
}
.team-row.winner { background: rgba(224,107,43,.15); }
.team-row.tbd    { opacity: .5; }

.team-name {
  font-size: .8rem;
  font-weight: 500;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.team-row.winner .team-name { color: #fff; font-weight: 700; }

.team-score {
  font-size: .85rem;
  font-weight: 700;
  color: #ccc;
  min-width: 22px;
  text-align: right;
}
.team-row.winner .team-score { color: var(--color-primary, #e06b2b); }

/* ── Empty state ─────────────────────────────────────────── */
.bracket-empty {
  padding: 2rem;
  color: #888;
  font-style: italic;
}

/* ── Champion banner ─────────────────────────────────────── */
.champion-banner {
  background: linear-gradient(135deg, #2a1f00, #3d2d00, #2a1f00);
  border: 1px solid #7a5c00;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.champion-inner {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.champion-trophy {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255,215,0,.5));
}

.champion-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
}

.champion-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #c8971a;
}

.champion-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: .02em;
  text-shadow: 0 0 20px rgba(255,215,0,.4);
}

/* ── Modal overlay ──────────────────────────────────────── */
.pm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.pm-overlay.active { display: flex; }

/* ── Modal box ──────────────────────────────────────────── */
.pm-modal {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
  overflow: hidden;
  position: relative;
  animation: pmSlideIn .2s ease;
}
@keyframes pmSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.pm-close {
  position: absolute;
  top: .6rem; right: .75rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
  z-index: 1;
}
.pm-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.pm-header {
  background: #252525;
  padding: 1rem 2.5rem 1rem 1.25rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-primary, #e06b2b);
  border-bottom: 1px solid #2e2e2e;
}

.pm-body { padding: 1rem 1.25rem; }

.pm-meta-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: #999;
  margin-bottom: .5rem;
}
.pm-icon { font-size: .85rem; }

.pm-teams {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  background: #111;
  border-radius: 8px;
  padding: .75rem;
  border: 1px solid #2a2a2a;
}

.pm-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  min-width: 0;
}
.pm-team.tbd { opacity: .45; }

.pm-team-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #555;
}

.pm-team-name {
  font-size: .9rem;
  font-weight: 600;
  color: #ccc;
  text-align: center;
  word-break: break-word;
}
.pm-team.winner .pm-team-name { color: #fff; font-weight: 700; }

.pm-team-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: #444;
  line-height: 1;
}
.pm-team.winner .pm-team-score { color: var(--color-primary, #e06b2b); }

.pm-vs {
  font-size: .65rem;
  font-weight: 700;
  color: #444;
  letter-spacing: .05em;
  flex-shrink: 0;
}

.pm-notes {
  font-size: .75rem;
  color: #777;
  font-style: italic;
  text-align: center;
  padding-top: .5rem;
  border-top: 1px solid #222;
  margin-top: .25rem;
}