/* Shared tournament and point-leader navigation; safe-area gaps also fit landscape. */
#bracketNav {
  --br-nav-bg: #fff;
  --br-nav-text: #202b35;
  --br-nav-line: #b9c4cf;
  box-sizing: border-box;
  width: 280px;
  max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(100vh - 74px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 74px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 4px;
  padding: 8px;
  color: var(--br-nav-text);
  background: var(--br-nav-bg);
  border: 1px solid var(--br-nav-line);
  border-radius: 6px;
  color-scheme: light;
  transition: none;
}
html[data-theme="dark"] #bracketNav {
  --br-nav-bg: #1c222b;
  --br-nav-text: #e7edf4;
  --br-nav-line: #627082;
  color-scheme: dark;
}
#bracketNav[hidden],
#bracketNav [hidden],
.br-follow-marker[hidden] { display: none !important; }
#bracketMenuBtn {
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  min-height: 44px;
  height: 44px;
}
#bracketNav > .bracket-nav-link { flex-shrink: 0; line-height: 1.5; }
#bracketNav .br-guide {
  flex-shrink: 0;
  border-bottom: 1px solid var(--br-nav-line);
  margin-bottom: 5px;
}
#bracketNav .br-guide summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
}
#bracketNav .br-guide summary::-webkit-details-marker { display: none; }
#bracketNav .br-guide summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin: -4px 4px 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
#bracketNav .br-guide[open] summary::after {
  margin-top: 4px;
  transform: rotate(225deg);
}
#bracketNav .br-guide__content {
  padding: 0 2px 8px;
  font-size: 12px;
  line-height: 1.5;
}
#bracketNav .br-guide__content p { margin: 0 0 8px; }
#bracketNav .br-guide__content p:last-child { margin-bottom: 0; }
#bracketNav .br-follow { flex-shrink: 0; margin-top: 6px; }
#bracketNav .br-follow label {
  display: block;
  margin: 0 0 5px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
}
#bracketNav .br-follow select,
#bracketNav .br-find input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px;
  background: var(--br-nav-bg);
  color: var(--br-nav-text);
  border: 1px solid var(--br-nav-line);
  border-radius: 4px;
  font: 400 16px/1.4 system-ui, sans-serif;
}
#bracketNav .br-follow select { appearance: auto; text-transform: none; }
#bracketNav .br-follow select:disabled { opacity: .65; }
#bracketNav .br-follow__bracket {
  display: block;
  margin-top: 7px;
  color: #006d86;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: underline;
}
html[data-theme="dark"] #bracketNav .br-follow__bracket { color: #75dfef; }
#bracketNav .br-find { flex-shrink: 0; padding-top: 8px; border-top: 1px solid var(--br-nav-line); }
#bracketNav .br-find .btn {
  min-height: 36px;
  padding: 6px 12px;
  color: var(--br-nav-text);
  background: var(--br-nav-bg);
  border: 1px solid var(--br-nav-line);
}
#bracketNav .br-find__count { margin-left: auto; }
#bracketNav :is(a, button, select, input, summary):focus-visible,
#bracketMenuBtn:focus-visible { outline: 3px solid #168fe5; outline-offset: 2px; }
.tournament-bracket .match-card.is-following {
  /* An inset accent leaves winner/loser text and the independent focus outline intact. */
  box-shadow: inset 3px 0 #35d7ef, inset 0 0 0 1px #35d7ef;
}
.match-card .br-player-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.match-card .br-player-name > a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card .br-follow-marker {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 3px;
  background: #b4f3fa;
  color: #073d49;
  font: 700 9px/1.4 system-ui, sans-serif;
  letter-spacing: .02em;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
}
.match-card .br-follow-prev,
.match-card .br-follow-next {
  flex: 0 0 auto;
  min-width: 24px;
  min-height: 18px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: #073d49;
  font: 700 15px/18px system-ui, sans-serif;
  cursor: pointer;
}
.match-card .br-follow-prev {
  margin: -1px 4px -1px -3px;
  border-right: 1px solid #45828b;
  border-radius: 2px 0 0 2px;
}
.match-card .br-follow-next {
  margin: -1px -3px -1px 4px;
  border-left: 1px solid #45828b;
  border-radius: 0 2px 2px 0;
}
.match-card :is(.br-follow-prev, .br-follow-next):hover { background: #80e2ef; }
.match-card :is(.br-follow-prev, .br-follow-next):focus-visible { outline: 2px solid #073d49; outline-offset: -2px; }
