:root {
  --cw-bg: #f6f8fa;
  --cw-surface: #ffffff;
  --cw-border: #dee2e6;
  --cw-accent: #1d4ed8;
  --cw-nav-bg: #1e3a5f;
  --cw-nav-active-bar: #93c5fd;
}

body {
  background-color: var(--cw-bg);
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body[data-site="vkoshp"] {
  --cw-accent: #3730a3;
  --cw-nav-bg: #2e266d;
  --cw-nav-active-bar: #c4b5fd;
}

main {
  flex: 1 0 auto;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.surface-card {
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: 0.5rem;
}

.site-header {
  border-bottom: 1px solid var(--cw-border);
}

.site-header-logos img {
  max-height: 52px;
  max-width: min(100%, 320px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.site-header-title {
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.site-title-link {
  color: #111827;
  text-decoration: none;
}

.site-title-link:hover,
.site-title-link:focus-visible {
  color: var(--cw-accent);
}

.site-season-menu {
  max-height: min(22rem, 70dvh);
  overflow-y: auto;
}

.site-season-menu .dropdown-item.active .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
}

.site-navbar {
  background-color: var(--cw-nav-bg);
  padding-block: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.site-nav-toggler {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 0.3rem 0.65rem;
}

.site-navbar .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.94rem;
  padding: 0.6rem 0.85rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link:focus-visible {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.site-navbar .navbar-nav .nav-link[aria-current="page"],
.site-navbar .navbar-nav .nav-link.active {
  color: #ffffff;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 -3px 0 var(--cw-nav-active-bar);
}

@media (max-width: 991.98px) {
  .site-navbar {
    padding-block: 0.25rem;
  }

  .site-navbar .navbar-collapse {
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 0.25rem;
  }

  .site-navbar .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    white-space: normal;
  }

  .site-navbar .navbar-nav .nav-link[aria-current="page"],
  .site-navbar .navbar-nav .nav-link.active {
    box-shadow: inset 3px 0 0 var(--cw-nav-active-bar);
  }
}

.sponsors-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.sponsors-block img {
  max-width: 100%;
  height: auto;
  margin-block: 0.35rem;
}

.sponsors-block {
  text-align: center;
}

/* Pre-styled blocks for sanitized/trusted HTML pages and news */
.rich-content {
  line-height: 1.65;
  font-size: 1rem;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.rich-content > :last-child {
  margin-bottom: 0;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.65rem;
  color: #111827;
}

.rich-content h1:first-child,
.rich-content h2:first-child,
.rich-content h3:first-child {
  margin-top: 0;
}

.rich-content p,
.rich-content ul,
.rich-content ol {
  margin-bottom: 0.85rem;
}

.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.rich-content blockquote {
  border-left: 3px solid #93c5fd;
  padding-left: 1rem;
  color: #4b5563;
  margin: 1rem 0;
}

.rich-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.rich-content table th,
.rich-content table td {
  border: 1px solid var(--cw-border);
  padding: 0.45rem 0.65rem;
}

.rich-content table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.cred-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  background-color: #f3f4f6;
  padding: 0.12rem 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid #e5e7eb;
  user-select: all;
}

/* Standings matrix */
.container-standings {
  max-width: 1560px;
}

.standings-card {
  overflow: hidden;
}

.standings-scroll {
  overflow: auto;
  max-width: 100%;
  max-height: 80vh;
  max-height: 80dvh;
}

.standings-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.standings-table th,
.standings-table td {
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--cw-border);
  border-right: 1px solid var(--cw-border);
}

.standings-table th:last-child,
.standings-table td:last-child {
  border-right: 0;
}

.standings-table tbody tr:last-child td {
  border-bottom: 0;
}

.standings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #f8f9fa;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.standings-table th.st-rank,
.standings-table td.st-rank {
  width: 3rem;
  text-align: center;
  white-space: nowrap;
}

.standings-table th.st-team,
.standings-table td.st-team {
  min-width: 13rem;
}

.standings-table th.st-stat,
.standings-table td.st-stat {
  width: 3.5rem;
  min-width: 3.25rem;
  text-align: center;
  white-space: nowrap;
  padding-inline: 0.45rem;
}

.standings-table th.st-prob,
.standings-table td.st-prob {
  min-width: 2.55rem;
  text-align: center;
  white-space: nowrap;
  padding: 0.3rem 0.2rem;
}

.st-cell-ok {
  background-color: #d1e7dd !important;
  color: #0f5132 !important;
  font-weight: 600;
}

.st-cell-first {
  background-color: #a3cfbb !important;
  color: #0a3622 !important;
  font-weight: 700;
}

.st-cell-err {
  background-color: #f8d7da !important;
  color: #842029 !important;
}

.st-cell-pend {
  background-color: #fff3cd !important;
  color: #664d03 !important;
  font-weight: 600;
}

.st-time {
  display: block;
  font-size: 0.72em;
  font-weight: 400;
  line-height: 1.1;
  opacity: 0.85;
}

.st-row-unranked td {
  color: #6c757d;
}

.st-row-dq td {
  background-color: #f8d7da !important;
}
