/* Shared first-screen rhythm; custom scenes keep their own composition. */
body[data-bb-page]:is([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Messages"],[data-bb-page="Tournament"]){--bb-screen-gap:28px}
body[data-bb-page]:is([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Messages"],[data-bb-page="Tournament"]) main{max-width:1288px!important;padding:32px 24px 64px!important;min-height:calc(100svh - 230px)!important}
body:where([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Messages"],[data-bb-page="Tournament"]) main h1{font-size:clamp(28px,3.4vw,44px)!important;line-height:1.15!important;letter-spacing:-.025em!important}
body:where([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Tournament"]) main>[style*="flex-direction: column"]{gap:28px!important}
body:where([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Tournament"]) main [data-eyebrow]{display:none!important}
body[data-bb-page="Ratings"] main>div>div:nth-child(2){margin-top:0!important}
body[data-bb-page="Ratings"] main>div>section:nth-child(3){margin-top:0!important}
/* Keep the metric explanation beyond the opening podium viewport. */
body[data-bb-page="Ratings"] main #how{margin-top:max(32px,calc(100svh - 770px))!important}
body:where([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Messages"],[data-bb-page="Tournament"]) main :is(.bbs-btn,.hm-cta,.hm-ghost,.screen-primary){min-height:44px!important;border-radius:5px!important;box-sizing:border-box;font-size:14px!important}
.screen-primary{display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:11px 18px;background:#e5252a;color:white;text-decoration:none;font-weight:600;white-space:nowrap;border:1px solid #e5252a;border-radius:5px}
.screen-primary:hover{background:#ff3745}.screen-primary:focus-visible{outline:2px solid #ff95a0;outline-offset:4px}
@media(max-width:680px){body[data-bb-page]:is([data-bb-page="Matches"],[data-bb-page="Teams"],[data-bb-page="Ratings"],[data-bb-page="Divisions"],[data-bb-page="Duels"],[data-bb-page="DuelProfile"],[data-bb-page="WhoRuined"],[data-bb-page="MediaLeague"],[data-bb-page="Messages"],[data-bb-page="Tournament"]) main{padding:24px 18px 48px!important}.screen-primary{white-space:normal}body[data-bb-page="Main"] .hm-actions{flex-wrap:wrap!important}}

/* Give the leagues their own opening screen before the weekly lineup scene. */
@media(min-width:1101px){body[data-bb-page][data-bb-page="Divisions"] main{padding-top:96px!important}body[data-bb-page="Divisions"] .dv-2col{min-height:calc(100svh - 330px)}}
/* Keep shared footers past the opening viewport, even on short tabs. */
body[data-bb-page]:has(footer.bbs-foot) main{min-height:calc(100svh - 64px)!important}
@media(min-width:1101px){body[data-bb-page][data-bb-page="Matches"] main{padding-top:96px!important}}
@media(min-width:681px) and (max-width:1100px){body[data-bb-page][data-bb-page="Matches"] main{padding-top:56px!important}}

/* Typography and control rhythm. Keep each page's artwork, grid and hero scale. */
/* Locally hosted display font; Cyrillic and Latin share the same variable weight. */
@font-face {
  font-family: 'Barracuda Tektur';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/assets/fonts/tektur-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Barracuda Tektur';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/assets/fonts/tektur-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Barracuda Tektur';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/assets/fonts/tektur-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bb-font-ui: 'Golos Text', system-ui, sans-serif;
  --bb-font-display: 'Barracuda Tektur', 'Golos Text', sans-serif;
  --bb-control-height: 44px;
}
body[data-bb-page] {
  font-family: var(--bb-font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* The home page keeps its original display lettering. */
body[data-bb-page="Main"] {
  --bb-font-display: 'Unbounded', 'Golos Text', sans-serif;
}
body[data-bb-page] :is(button, input, select, textarea) {
  font-family: var(--bb-font-ui);
}
body[data-bb-page] .bbs :is(.bbs-nav a, .bbs-sub a) {
  font-family: var(--bb-font-ui) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.25;
  letter-spacing: 0;
}
body[data-bb-page] .bbs :is(.bbs-nav a[aria-current="page"], .bbs-sub a[aria-current="page"]) {
  font-weight: 600 !important;
}
body[data-bb-page] .bbs-head :is(.bbs-btn, .bbs-icon, .bb-auth-account) {
  box-sizing: border-box;
  height: 40px !important;
  min-height: 40px !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Display lettering belongs to headings; dense names and controls use UI text. */
body[data-bb-page]:is([data-bb-page="Matches"], [data-bb-page="Teams"], [data-bb-page="Ratings"], [data-bb-page="Divisions"], [data-bb-page="Duels"], [data-bb-page="DuelProfile"], [data-bb-page="WhoRuined"], [data-bb-page="MediaLeague"], [data-bb-page="Messages"], [data-bb-page="Tournament"], [data-bb-page="Search"], [data-bb-page="ProfileForm"]) main h1 {
  font-family: var(--bb-font-display) !important;
  font-size: clamp(28px, 3.1vw, 40px) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: -.015em !important;
  text-wrap: balance;
}
body[data-bb-page]:is([data-bb-page="Divisions"], [data-bb-page="Matches"]) main h2 {
  font-size: clamp(20px, 2.1vw, 28px) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -.015em !important;
}
body[data-bb-page] main [role="tablist"] > button {
  box-sizing: border-box;
  min-height: 48px !important;
  font-family: var(--bb-font-ui) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body[data-bb-page] main [role="tablist"] > button span {
  font-family: inherit !important;
  line-height: inherit;
  letter-spacing: 0 !important;
}
body[data-bb-page="Divisions"] .st-name,
body[data-bb-page="Matches"] .mt-name {
  font-family: var(--bb-font-ui) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 1.3 !important;
}
body[data-bb-page="Divisions"] :is(.st-val, .st-place) {
  font-family: var(--bb-font-ui) !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
body[data-bb-page="Divisions"] .st-grid {
  align-items: center;
}
body[data-bb-page="Matches"] .mt-grid {
  align-items: center;
  font-variant-numeric: tabular-nums;
}
body[data-bb-page="Matches"] .mt-go {
  line-height: 1.3;
  text-align: right;
}

/* Equal outer heights include borders, so neighbouring actions share a baseline. */
body[data-bb-page] :is(.hm-play, .hm-ghost, .screen-primary, .team-button, .btn, .fa-team-button) {
  box-sizing: border-box;
  font-family: var(--bb-font-ui) !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
  align-items: center;
  justify-content: center;
}
body[data-bb-page] .screen-primary {
  min-height: var(--bb-control-height) !important;
  font-size: 15px !important;
}
body[data-bb-page="Main"] .hm-first .hm-ghost {
  height: 48px !important;
  min-height: 48px !important;
  font-size: 15px !important;
  font-weight: 600;
}
body[data-bb-page="Main"] .hm-first .hm-actions {
  width: min(320px, 100%);
}
body[data-bb-page="Main"] .hm-first .hm-play {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  justify-content: center;
  width: 100%;
  gap: 18px;
  min-width: 0;
  height: 80px !important;
  min-height: 80px !important;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 30px !important;
  font-weight: 700;
  user-select: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
body[data-bb-page="Main"] .hm-first .hm-play::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(32, 9, 14, .72);
  box-shadow: 0 4px 22px rgba(229, 37, 42, .16), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform .22s cubic-bezier(.2, .75, .25, 1), background-color .22s ease, box-shadow .22s ease;
}
body[data-bb-page="Main"] .hm-play-mark {
  display: block;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(32, 4, 10, .68);
  filter: drop-shadow(0 0 10px rgba(229, 37, 42, .46));
  transition: filter .22s ease, transform .22s cubic-bezier(.2, .75, .25, 1);
}
body[data-bb-page="Main"] .hm-play-label {
  display: inline-block;
  transition: transform .22s cubic-bezier(.2, .75, .25, 1);
}
body[data-bb-page="Main"] .hm-first .hm-play:is(:hover, :focus-visible) {
  border-color: transparent;
}
body[data-bb-page="Main"] .hm-first .hm-play:is(:hover, :focus-visible)::before {
  transform: translateY(-3px);
  background: rgba(51, 10, 18, .82);
  box-shadow: 0 8px 30px rgba(229, 37, 42, .3), inset 0 1px 0 rgba(255, 255, 255, .08);
}
body[data-bb-page="Main"] .hm-play:is(:hover, :focus-visible) .hm-play-mark {
  filter: drop-shadow(0 0 15px rgba(245, 37, 56, .7));
}
body[data-bb-page="Main"] .hm-play:is(:hover, :focus-visible) :is(.hm-play-mark, .hm-play-label) {
  transform: translateY(-3px);
}
body[data-bb-page="Main"] .hm-first .hm-play:active::before,
body[data-bb-page="Main"] .hm-play:active :is(.hm-play-mark, .hm-play-label) {
  transform: translateY(1px);
}
@media (prefers-reduced-motion: reduce) {
  body[data-bb-page="Main"] .hm-first .hm-play,
  body[data-bb-page="Main"] .hm-first .hm-play::before,
  body[data-bb-page="Main"] :is(.hm-play-mark, .hm-play-label) {
    transition: none;
    transform: none !important;
  }
}
body[data-bb-page="Main"] .hm-ey {
  font-family: var(--bb-font-ui) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: .12em !important;
  line-height: 1.5;
}
body[data-bb-page="Main"] .hm-headline {
  font-family: var(--bb-font-display) !important;
  font-weight: 700 !important;
  line-height: 1.06 !important;
  letter-spacing: -.035em !important;
}
body[data-bb-page="Main"] .hm-first .hm-hero > div > p:not(.hm-ey) {
  font-size: 18px !important;
  line-height: 1.6 !important;
  max-width: 510px !important;
}
body[data-bb-page="Main"] .hm-tile-copy {
  width: 100%;
  min-height: 136px;
}
body[data-bb-page="Main"] .hm-tile-title {
  font-size: 21px !important;
  font-weight: 600 !important;
  letter-spacing: -.02em;
  line-height: 1.25;
}
body[data-bb-page="Main"] .hm-tile-description {
  font-size: 15px !important;
  line-height: 1.55 !important;
}
body[data-bb-page="Main"] .hm-tile-action {
  margin-top: auto;
  font-size: 15px !important;
  line-height: 1.3;
}
body[data-bb-page="Teams"] .tr-tn {
  font-size: 17px !important;
  font-weight: 600;
  line-height: 1.3;
}
body[data-bb-page="Teams"] .tr-search {
  min-height: 48px;
  align-items: center;
}

/* Search/filter labels remain legible without enlarging the player cards. */
body[data-bb-page]:is([data-bb-page="Search"], [data-bb-page="ProfileForm"]) .filter-bar :is(select, input:not([type="checkbox"]), .role-segment button, .sleep-filter) {
  box-sizing: border-box;
  min-height: 40px !important;
  font-size: 14px !important;
  line-height: 1.2;
}
body[data-bb-page]:is([data-bb-page="Search"], [data-bb-page="ProfileForm"]) :is(.filter-bar label, .role-filter, .field, .positions legend, .role-text, .listing-fact, .bio) {
  font-size: 14px;
}
body[data-bb-page]:is([data-bb-page="Search"], [data-bb-page="ProfileForm"]) :is(.listing-action, .form-actions .btn, .dialog-actions .btn) {
  min-height: var(--bb-control-height);
  font-size: 14px;
}
body[data-bb-page] :is(.account-intro, .team-muted, .fa-save-notice) {
  line-height: 1.55;
}
@media (max-width: 680px) {
  body[data-bb-page="Main"] .hm-first .hm-play {
    height: 72px !important;
    min-height: 72px !important;
    gap: 16px;
    padding: 0 20px;
    font-size: 26px !important;
  }
  body[data-bb-page="Main"] .hm-play-mark {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }
  body[data-bb-page="Main"] .hm-headline {
    font-size: clamp(32px, 7.7vw, 48px) !important;
  }
  body[data-bb-page="Main"] .hm-first .hm-hero > div > p:not(.hm-ey) {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }
  body[data-bb-page="Main"] .hm-ey {letter-spacing: .06em !important;}
  body[data-bb-page="Main"] .hm-tile-copy {min-height: 0;}
  body[data-bb-page="Main"] .hm-tile-action {margin-top: 4px;}
  body[data-bb-page="Teams"] .tr-tn {font-size: 15px !important;}
  body[data-bb-page="Divisions"] .st-name,
  body[data-bb-page="Matches"] .mt-name {font-size: 14px !important;}
  body[data-bb-page="Matches"] .mt-name {
    text-transform: none !important;
    white-space: normal !important;
    overflow-wrap: normal;
  }
  body[data-bb-page="Matches"] .mt-line > span:has(> .mt-emb) {
    gap: 8px !important;
  }
  body[data-bb-page="Matches"] .mt-emb {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Stronger display titles, while roster cards and the awards retain their lettering. */
body[data-bb-page]:not([data-bb-page="Awards"]) h1 {
  font-family: var(--bb-font-display) !important;
  font-weight: 700 !important;
  letter-spacing: -.015em !important;
}
body[data-bb-page="Main"] :is(.hm-headline, .hm-tile-title, .hm-cup h2),
body[data-bb-page="Divisions"] :is(main h2, .wk-full h2),
body[data-bb-page="Matches"] main h2 {
  font-family: var(--bb-font-display) !important;
  font-weight: 700 !important;
  letter-spacing: -.015em !important;
}
body[data-bb-page="Main"] h1.hm-headline {
  font-weight: 800 !important;
  line-height: .98 !important;
  letter-spacing: -.02em !important;
}
@media (min-width: 681px) {
  body[data-bb-page="Main"] h1.hm-headline {
    font-size: clamp(40px, 5.6vw, 84px) !important;
  }
}

/* Artwork sits behind the existing leagues layout and fades before the rows. */
body[data-bb-page="Divisions"] .lg-aura::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -220px;
  width: min(1120px, 90vw);
  height: 680px;
  background: url('/assets/5ff46c2e264a08c3f88caf2f7b86d47d.jpg') center top / cover no-repeat;
  opacity: .27;
  filter: var(--bb-aegis-filter, grayscale(1) sepia(1) saturate(5) hue-rotate(315deg));
  transition: filter .35s ease;
  -webkit-mask-image: radial-gradient(ellipse 60% 56% at 60% 33%, #000 22%, transparent 82%);
  mask-image: radial-gradient(ellipse 60% 56% at 60% 33%, #000 22%, transparent 82%);
  pointer-events: none;
}

body[data-bb-page="Divisions"] .lg-wrap[data-league="first"] {
  --bb-aegis-filter: grayscale(1) brightness(1.12);
}
body[data-bb-page="Divisions"] .lg-wrap[data-league="second"] {
  --bb-aegis-filter: grayscale(1) sepia(.9) saturate(1.8) hue-rotate(345deg);
}
@media (prefers-reduced-motion: reduce) {
  body[data-bb-page="Divisions"] .lg-aura::before {transition: none;}
}

/* Match background artwork stays subordinate to the dark reading area. */
body[data-bb-page="Matches"] main {
  position: relative;
  isolation: isolate;
}
body[data-bb-page="Matches"] main::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: min(0px, calc((1288px - 100vw) / 2));
  right: min(0px, calc((1288px - 100vw) / 2));
  background: linear-gradient(180deg, #140e0f 0%, rgba(20,14,15,.56) 15%, rgba(20,14,15,.74) 75%, #140e0f 100%),
    radial-gradient(ellipse 46% 65% at 50% 55%, rgba(20,14,15,.75) 35%, rgba(20,14,15,.1) 100%),
    none;
  opacity: .8;
  pointer-events: none;
}
@media (max-width: 680px) {
  body[data-bb-page="Divisions"] .lg-aura::before {
    top: -40px;
    right: -130px;
    width: 560px;
    height: 350px;
    opacity: .18;
  }
  body[data-bb-page="Matches"] main::before {opacity: .5;}
}

/* The same quiet LED sweep follows every site's header, without changing its layout. */
body[data-bb-page] .bbs {position: relative;}
body[data-bb-page="AdminPreview"] .ap-topbar {position: relative;}
body[data-bb-page] .bbs::after,
body[data-bb-page="Portal"] header::after,
body[data-bb-page="AdminPreview"] .ap-topbar::after {
  content: '';
  position: absolute;
  z-index: 40;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background-image: linear-gradient(90deg, transparent, rgba(255,64,70,.95), transparent);
  background-size: 32% 100%;
  background-repeat: no-repeat;
  background-position: -48% 0;
  box-shadow: 0 0 12px 1px rgba(229,37,42,.24);
  animation: bbHeaderLed 7s cubic-bezier(.45,0,.55,1) infinite;
}
@keyframes bbHeaderLed {
  from {background-position: -48% 0;}
  to {background-position: 148% 0;}
}
body[data-bb-page="Matches"] .mt-led {display: none;}
@media (prefers-reduced-motion: reduce) {
  body[data-bb-page] .bbs::after,
  body[data-bb-page="Portal"] header::after,
  body[data-bb-page="AdminPreview"] .ap-topbar::after {
    animation: none;
    background-position: 50% 0;
  }
}
