/* A filled segment marks the selected results view, including over a map. The leaderboard's
   switch (.lb-view) is in the list too: it was the one directory still on a pale selected tab. */
html :is(.tn-view, .ve-view, .co-view, .lb-view) [role="tab"][aria-selected="true"] {
  color: var(--ds-on-brand);
  background: var(--ds-brand);
  box-shadow: none;
}
html :is(.tn-view, .ve-view, .co-view, .lb-view) [role="tab"][aria-selected="false"]:hover {
  color: var(--ds-ink-900);
  background: var(--ds-surface-2);
}
/* The deep tournament gradient can approach the dark page surface. */
#mainContent .tournament-tab-nav .nav-link.active {
  text-decoration: underline;
  text-decoration-thickness: .12em;
  text-underline-offset: .23em;
}
@media (forced-colors: active) {
  :is(.tn-view, .ve-view, .co-view, .lb-view) [role="tab"][aria-selected="true"] {
    outline: 2px solid SelectedItem;
    outline-offset: -3px;
  }
}

/* The organizer's long forms share section destinations on desktop and phones. */
.tournament-form-contents {
  margin-block: var(--ds-space-4) var(--ds-space-5);
  padding-inline: var(--ds-space-4);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
}
.tournament-form-contents > summary {
  min-height: var(--ds-control-min);
  padding-block: var(--ds-space-3);
  color: var(--ds-ink-900);
  font-size: var(--ds-type-body-small);
  font-weight: 650;
  cursor: pointer;
}
.tournament-form-contents nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-1) var(--ds-space-3);
  border-top: 1px solid var(--ds-border);
  padding-block: var(--ds-space-2);
}
.tournament-form-contents nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--ds-control-min);
  padding-inline: var(--ds-space-2);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-ink-800);
  font-size: var(--ds-type-body-small);
  text-underline-offset: .2em;
}
.tournament-form-contents nav a:is(:hover,:focus-visible) {
  color: var(--ds-ink-900);
  background: var(--ds-surface-2);
}
:is(#createTournamentForm, #editTournamentForm) .form-section-title {
  scroll-margin-block-start: var(--ds-space-8);
  font-size: var(--ds-type-heading-3);
  line-height: 1.2;
}
:is(#createTournamentForm, #editTournamentForm) .form-section-sub {
  color: var(--ds-ink-700);
  font-size: var(--ds-type-body-small);
}
:is(#createTournamentForm, #editTournamentForm) .cover-picker-controls { min-width: 0; }

/* The names and match status take priority over the card frame. */
html .competition-match-heading {
  color: var(--ds-ink-900);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-inline-start: var(--ds-space-1) solid var(--ds-brand);
}
html .competition-match-heading > .card-body {
  padding: clamp(var(--ds-space-4), 3vw, var(--ds-space-6));
  min-width: 0;
}
html .competition-match-heading h1 {
  font-size: var(--ds-type-heading-2);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
html .competition-match-heading .tm-display {
  margin-top: var(--ds-space-2);
  font-size: var(--ds-type-display-small);
  font-variant-numeric: tabular-nums;
}
.game-facts .game-fact-value {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* Account, receipt and order pages use the same reading width and section rhythm. */
#mainContent .market-account-page { max-width: 56rem; margin-inline: auto; }
#mainContent .market-account-heading {
  padding-block: var(--ds-space-3) var(--ds-space-4);
  margin-bottom: var(--ds-space-4);
  border-bottom: 1px solid var(--ds-border);
}
.market-account-heading h1, .market-return h1 {
  overflow-wrap: anywhere;
  margin-bottom: var(--ds-space-2);
}
.market-account-heading > :last-child { margin-bottom: 0; }
.market-account-page :is(p, label, summary), .market-return p { max-width: 70ch; }
.market-return .d-grid { margin-block-start: var(--ds-space-5); }

/* Keep the status and its explanation together on a small screen. */
html .payment-container .payment-status-header.pending {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
}
html .payment-container .payment-status-header.pending::before { content: none; }
html .payment-container .payment-status-header.pending :is(h1, p, strong) { color: var(--ds-ink-900); }
html .payment-container .payment-status-header.pending .status-icon-wrapper {
  background: var(--ds-brand-soft);
  color: var(--ds-brand-strong);
  border: 0;
}
html .payment-container .payment-status-header.pending .spinner-border { color: var(--ds-brand-strong); }
@media (max-width: 35.99em) {
  .tournament-form-contents nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-space-1);
  }
  #mainContent .market-account-page { padding-inline: 0; }
  html .market-return .btn { white-space: normal; }
}
