/*
 * KDB COMMON BACKGROUND · NIGHT CIRCUIT V2
 *
 * Deliberately scoped to public pages. RaceControl pages carry
 * .kdb-marshal-page and are excluded from this layer.
 * Rollback: remove this stylesheet link from the public templates.
 */
body.kdb-design-system-v1:not(.kdb-marshal-page),
body.kdb-bracket-v10.kdb-design-system-v1:not(.kdb-marshal-page) {
  background-color: #020c14 !important;
  overflow-x: hidden;
  background-image:
    linear-gradient(90deg, rgba(2, 12, 20, .97) 0%, rgba(2, 12, 20, .91) 40%, rgba(2, 12, 20, .93) 100%),
    linear-gradient(135deg, transparent 0 57%, rgba(53, 200, 245, .12) 57.4% 60%, transparent 60.4% 66%, rgba(223, 245, 250, .09) 66.4% 68.2%, transparent 68.6%),
    url("/static/core/images/kdb-v5-1/hero-season-clean-v2.5737ef0f46ce.webp");
  background-position: center top, center top, center top;
  background-size: cover, 100% 100%, cover;
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
}

/* A wide table may still scroll inside its own wrapper, but it must never
   widen the mobile document viewport itself. */
html.kdb-design-system-v1:has(body:not(.kdb-marshal-page)) {
  overflow-x: hidden;
}

body.kdb-design-system-v1:not(.kdb-marshal-page)::before,
body.kdb-bracket-v10.kdb-design-system-v1:not(.kdb-marshal-page)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 12, 20, .54) 0%, rgba(2, 12, 20, .70) 42%, rgba(2, 12, 20, .98) 100%),
    repeating-linear-gradient(124deg, transparent 0 210px, rgba(53, 200, 245, .035) 210px 214px, transparent 214px 350px);
}

body.kdb-design-system-v1:not(.kdb-marshal-page) .site-atmosphere,
body.kdb-bracket-v10.kdb-design-system-v1:not(.kdb-marshal-page) .kdb-v10-atmosphere {
  opacity: .16;
}

body.kdb-design-system-v1:not(.kdb-marshal-page) :is(
  .kdb-page-shell,
  .kdb-premium-ui,
  .kdb-pilots-v17__shell,
  .kdb-reg-page,
  .bracket-shell,
  .kdb-v10-main
) {
  background: transparent;
}

@media (max-width: 820px) {
  body.kdb-design-system-v1:not(.kdb-marshal-page),
  body.kdb-bracket-v10.kdb-design-system-v1:not(.kdb-marshal-page) {
    background-position: 58% top, center top, 58% top;
    background-size: auto 100%, 100% 100%, auto 100%;
    background-attachment: scroll, scroll, scroll;
  }

  body.kdb-design-system-v1:not(.kdb-marshal-page)::before,
  body.kdb-bracket-v10.kdb-design-system-v1:not(.kdb-marshal-page)::before {
    position: absolute;
    min-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.kdb-design-system-v1:not(.kdb-marshal-page),
  body.kdb-bracket-v10.kdb-design-system-v1:not(.kdb-marshal-page) {
    background-attachment: scroll;
  }
}
