/* eRift V30 — shared header and footer overrides. Load AFTER /style.css. */
body > header.topbar {position:sticky !important;top:0 !important;z-index:1000 !important;width:100% !important;max-width:none !important;}
header.topbar .main-nav a {position:relative !important;transition:color .18s ease !important;}
header.topbar .main-nav a::after {content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:#d7aa64;transform:scaleX(0);transform-origin:center;transition:transform .2s ease;}
header.topbar .main-nav a:hover,header.topbar .main-nav a[aria-current="page"] {color:#f4d4a0 !important;}
header.topbar .main-nav a:hover::after,header.topbar .main-nav a[aria-current="page"]::after {transform:scaleX(1);}
footer.er-ref-footer {display:block !important;position:relative !important;width:100% !important;max-width:none !important;margin:32px 0 0 !important;padding:22px 0 0 !important;background:#07121f !important;border-top:1px solid #25344a !important;box-sizing:border-box !important;transform:none !important;left:auto !important;right:auto !important;}
footer.er-ref-footer > .er-footer-inner {display:grid !important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) !important;align-items:center !important;gap:30px !important;width:min(1500px,calc(100% - 48px)) !important;max-width:none !important;margin:0 auto !important;padding:0 0 20px !important;box-sizing:border-box !important;}
footer.er-ref-footer .er-footer-brand {grid-column:1 !important;justify-self:start !important;text-align:left !important;min-width:0 !important;}
footer.er-ref-footer .er-footer-brand img {width:145px !important;height:auto !important;max-height:48px !important;object-fit:contain !important;display:block !important;}
footer.er-ref-footer .er-footer-brand p {max-width:460px !important;margin:9px 0 0 !important;color:#8998aa !important;font-size:11px !important;line-height:1.55 !important;white-space:normal !important;}
footer.er-ref-footer .er-footer-contact {grid-column:2 !important;justify-self:center !important;display:flex !important;flex-direction:column !important;align-items:center !important;gap:12px !important;min-width:0 !important;}
footer.er-ref-footer .er-footer-links {display:flex !important;align-items:center !important;justify-content:center !important;gap:20px !important;flex-wrap:wrap !important;}
footer.er-ref-footer .er-footer-links a,footer.er-ref-footer .er-footer-contact>a {font-size:11px !important;color:#bac5d3 !important;text-decoration:none !important;white-space:nowrap !important;}
footer.er-ref-footer a:hover {color:#e4bd7e !important;}
footer.er-ref-footer .er-footer-social {grid-column:3 !important;justify-self:end !important;display:flex !important;align-items:center !important;justify-content:flex-end !important;gap:18px !important;min-width:0 !important;}
footer.er-ref-footer a.er-social-icon {display:inline-flex !important;align-items:center !important;justify-content:center !important;width:30px !important;height:30px !important;color:#e4e9f2 !important;text-decoration:none !important;}
footer.er-ref-footer a.er-social-icon svg {display:block !important;width:23px !important;height:23px !important;}
footer.er-ref-footer .cookie-banner {position:relative !important;inset:auto !important;transform:none !important;width:100% !important;max-width:none !important;margin:0 !important;padding:0 !important;background:#091624 !important;border-top:1px solid #203044 !important;box-shadow:none !important;}
footer.er-ref-footer .cookie-content {width:min(1500px,calc(100% - 48px)) !important;max-width:none !important;min-height:48px !important;margin:0 auto !important;padding:10px 0 !important;display:flex !important;align-items:center !important;justify-content:center !important;gap:25px !important;}
@media(max-width:800px){footer.er-ref-footer > .er-footer-inner {grid-template-columns:minmax(0,1fr) auto !important;align-items:start !important;gap:16px !important;width:calc(100% - 32px) !important;}footer.er-ref-footer .er-footer-brand{grid-column:1 !important;grid-row:1 !important;}footer.er-ref-footer .er-footer-social{grid-column:2 !important;grid-row:1 !important;gap:9px !important;}footer.er-ref-footer .er-footer-contact{grid-column:1/-1 !important;grid-row:2 !important;justify-self:start !important;align-items:flex-start !important;}footer.er-ref-footer .er-footer-links{justify-content:flex-start !important;gap:14px !important;}footer.er-ref-footer .er-footer-brand img{width:120px !important;}footer.er-ref-footer .er-footer-brand p{font-size:10px !important;}footer.er-ref-footer .cookie-content{width:calc(100% - 32px) !important;flex-wrap:wrap !important;gap:10px !important;}}

/* V31: underline belongs to the nav item, not below the header. */
header.topbar .main-nav a { position:relative !important; }
header.topbar .main-nav a::after { bottom:0 !important; height:2px !important; opacity:0; }
header.topbar .main-nav a:hover::after,header.topbar .main-nav a:focus-visible::after,header.topbar .main-nav a.active::after,header.topbar .main-nav a[aria-current="page"]::after { opacity:1 !important; transform:scaleX(1) !important; }
/* Footer is now a direct body child on every page, never nested in main. */

/* V32 — consistent site typography and short-page footer position. */
html { min-height:100%; }
body { min-height:100vh !important; display:flex !important; flex-direction:column !important; }
body > main { flex:1 0 auto !important; }
body > footer.er-ref-footer { flex:0 0 auto !important; margin-top:auto !important; }
/* Match the original homepage navigation styling on every page. */
header.topbar .main-nav { align-items:center !important; }
header.topbar .main-nav a {
  font-family:Arial,Helvetica,sans-serif !important;
  font-size:12px !important; font-weight:800 !important;
  text-transform:uppercase !important; letter-spacing:.8px !important;
  line-height:1.2 !important; height:100% !important;
  padding-top:0 !important; padding-bottom:0 !important;
  margin-top:0 !important; margin-bottom:0 !important;
  display:flex !important; align-items:center !important;
  transform:none !important; vertical-align:middle !important;
}
/* Gold indicator aligned within the nav item, never below header. */
header.topbar .main-nav a::after { bottom:7px !important; }
@media(max-width:800px){ body > main{flex:1 0 auto !important;} }

/* V33 — fix homepage navigation without changing match data scripts. */
header.topbar .main-nav a,
body:has(.er-reference-layout) header.topbar .main-nav a {
  box-sizing:border-box !important; border-bottom:0 !important;
  padding:0 !important; margin:0 !important;
  color:#909bab !important;
}
header.topbar .main-nav a:hover,
header.topbar .main-nav a:focus-visible,
header.topbar .main-nav a[aria-current="page"] {color:#eac38a !important;}
header.topbar .main-nav a::after {
  content:"" !important; position:absolute !important;
  left:0 !important;right:0 !important;bottom:7px !important;
  height:2px !important;background:#d7aa64 !important;
  box-shadow:none !important;opacity:0 !important;
  transform:scaleX(0) !important;transition:transform .2s ease,opacity .2s ease !important;
}
header.topbar .main-nav a:hover::after,
header.topbar .main-nav a:focus-visible::after,
header.topbar .main-nav a[aria-current="page"]::after {
  opacity:1 !important;transform:scaleX(1) !important;
}
/* Legacy .active should not add an extra underline when aria-current is used. */
header.topbar .main-nav a.active:not([aria-current="page"]):not(:hover)::after {
  opacity:0 !important;transform:scaleX(0) !important;
}
/* The reserved ad must keep its own height instead of stretching to fill the
   Recent Matches column and visually touching the footer. */
.er-reference-layout .er-ref-bottom .er-players > .er-ad-sidebar {
  flex:0 0 96px !important;height:96px !important;min-height:96px !important;
  max-height:96px !important;align-self:stretch !important;
  margin-top:12px !important;opacity:.75 !important;
}
.er-reference-layout .er-ref-bottom {margin-bottom:28px !important;}
body:has(.er-reference-layout) main {padding-bottom:26px !important;}
@media(max-width:700px){
 .er-reference-layout .er-ref-bottom .er-players > .er-ad-sidebar {
   flex-basis:90px !important;height:90px !important;min-height:90px !important;max-height:90px !important;
 }
}

/* V34 — same header geometry as the homepage across all pages. */
@media (min-width:901px) {
  body > header.topbar .topbar-inner {
    width:min(1480px,calc(100% - 44px)) !important;
    max-width:1480px !important;
    min-height:62px;
    margin-left:auto !important;
    margin-right:auto !important;
    display:flex !important;
    align-items:center !important;
    box-sizing:border-box !important;
  }
  body > header.topbar .main-nav {flex:0 0 auto !important;align-items:center !important;}
  body > header.topbar .header-search,
  body > header.topbar .search-container,
  body > header.topbar .global-search,
  body > header.topbar [class*="search-wrap"] {margin-left:auto !important;}
  body > header.topbar .language-switcher,
  body > header.topbar .language-selector,
  body > header.topbar [class*="language-switch"],
  body > header.topbar [class*="lang-switch"] {flex:0 0 auto;margin-left:16px;}
}

/* V35 — cookie consent is viewport-fixed, not part of footer flow. */
footer.er-ref-footer #cookie-banner.cookie-banner {
  position:fixed !important;
  top:auto !important; right:0 !important; bottom:0 !important; left:0 !important;
  inset:auto 0 0 0 !important;
  z-index:2147483000 !important;
  width:100% !important; max-width:none !important;
  margin:0 !important; padding:0 !important;
  transform:none !important;
  background:#091624 !important;
  border-top:1px solid #39506a !important;
  box-shadow:0 -10px 36px rgba(0,0,0,.48) !important;
  box-sizing:border-box !important;
}
footer.er-ref-footer #cookie-banner.cookie-banner[hidden] {display:none !important;}
footer.er-ref-footer #cookie-banner .cookie-content {
  width:min(1500px,calc(100% - 32px)) !important;
  max-width:none !important;
  margin:0 auto !important;
  padding:14px 0 !important;
}
@media(max-width:700px) {
  footer.er-ref-footer #cookie-banner .cookie-content {
    display:flex !important;flex-direction:column !important;
    align-items:stretch !important;gap:12px !important;
  }
  footer.er-ref-footer #cookie-banner .cookie-actions {
    display:flex !important;justify-content:flex-end !important;gap:10px !important;
  }
}
/* Consistent gold section markers across the portal. */
html body :is(.section-header.section-header.section-header,.er-section-head.er-section-head.er-section-head,.er-roster-heading.er-roster-heading.er-roster-heading)::before{content:none!important;display:none!important}
html body :is(.section-header.section-header.section-header,.er-section-head.er-section-head.er-section-head,.er-roster-heading.er-roster-heading.er-roster-heading,.matches-group-header.matches-group-header.matches-group-header) h2,
html body .recent-changes-title.recent-changes-title.recent-changes-title,
html body .section-title.section-title.section-title{border-left:3px solid #d4b16d!important;padding-left:12px!important;box-sizing:border-box;}
html body :is(.section-header.section-header.section-header,.er-section-head.er-section-head.er-section-head,.er-roster-heading.er-roster-heading.er-roster-heading,.matches-group-header.matches-group-header.matches-group-header) h2::before{content:none!important;display:none!important}
/* Only neutral near-black pixels create a readability halo. */
:root{--er-crest-halo:url("/images/dark-logo-halo.svg?v=20261026-black-only#dark-logo-halo")}
html body img:is([src*="/team/"],[src*="/teams/"],[src*="logo" i],[class*="logo" i],[id*="logo" i]),
html body .es-tab-result img,
html body .er-compact-team img,
html body .team-match-team img,
html body .player-match-team img{filter:var(--er-crest-halo)!important}
html body:has(.er-reference-layout) .er-reference-layout.er-reference-layout .er-hero-v34 .er-cinema-team .er-cinema-logo img{filter:var(--er-crest-halo)!important}
footer.er-ref-footer .er-footer-brand p.er-data-credit{margin-top:0!important}

.stream-language{display:inline-flex;align-items:center;gap:8px}.stream-flag{width:22px;height:15px;object-fit:cover;border-radius:2px;flex-shrink:0}.er-streams-more{display:block;margin:14px auto 0;padding:11px 25px;border:1px solid #354b68;border-radius:7px;background:#142238;color:#c3d2e7;font:inherit;font-weight:700;cursor:pointer;transition:background .18s,color .18s}.er-streams-more:hover,.er-streams-more:focus-visible{background:#20324b;color:#e8c681;border-color:#b6965b}

/* Team logo and name share one accessible profile link. */
.er-team-heading-link{display:inline-flex;align-items:center;gap:10px;color:inherit;text-decoration:none}
a.er-team-heading-link:hover{color:#eac779}
a.er-team-heading-link:focus-visible{outline:2px solid #eac779;outline-offset:4px}
/* Keep linked headings full width so their background stays uniform. */
.lineup-team-header.er-team-heading-link,
.h2h-column-header.er-team-heading-link{display:flex;width:100%;box-sizing:border-box;color:#e8edf5;text-decoration:none}
a.er-team-heading-link:hover,
a.er-team-heading-link:focus-visible,
a.er-team-heading-link:hover > span,
a.er-team-heading-link:focus-visible > span,
a.er-team-heading-link:hover > strong,
a.er-team-heading-link:focus-visible > strong{color:#eac779}
.er-team-heading-link > span,.er-team-heading-link > strong,
.stream-link .stream-name{transition:color .18s ease}
.stream-link:hover .stream-name,
.stream-link:focus-visible .stream-name{color:#eac779}

/* Flat eRift branding stays crisp and never uses the team-crest halo. */
html body header.topbar .logo img[src*="/images/erift-logo.svg"],
html body footer.er-ref-footer .er-footer-brand img[src*="/images/erift-logo.svg"] {
  filter:none !important;
}
html body header.topbar .logo img[src*="/images/erift-logo.svg"] {
  display:block !important;
  width:160px !important;
  max-width:160px !important;
  height:auto !important;
  max-height:40px !important;
  object-fit:contain !important;
}
@media(max-width:700px) {
  html body header.topbar .logo img[src*="/images/erift-logo.svg"] {
    width:145px !important;
    max-width:145px !important;
  }
}
@media(max-width:390px) {
  html body header.topbar .logo img[src*="/images/erift-logo.svg"] {
    width:132px !important;
    max-width:132px !important;
  }
}

/* Legacy homepage readability classes must use the same black-only mask. */
html body .er-reference-layout img.er-logo-readable {
  filter:var(--er-crest-halo)!important;
}
/* These colored / outlined crests stay unfiltered, including opaque CDN names. */
html body img:is(
  [src*="/team/image/126059/"],[src*="top_esports" i],[src*="top-esports" i],
  [src*="/team/image/390/"],[src*="liquid" i],
  [src*="/team/image/88/"],[src*="g2-logo" i],[src*="g2-esports" i],[src*="g2_esports" i],
  [alt="TES" i],[alt="Top Esports" i],[alt="TL" i],[alt="Team Liquid" i],[alt="G2" i],[alt="G2 Esports" i]
) {
  --er-crest-halo:none;
}

/* Homepage defaults must not override active navigation text. */
html body:has(.er-reference-layout) header.topbar .main-nav a:hover,
html body:has(.er-reference-layout) header.topbar .main-nav a:focus-visible,
html body:has(.er-reference-layout) header.topbar .main-nav a[aria-current="page"] {
  color:#eac38a!important;
}
