/* Scoped statistics branch; the site's other navigation colours and fills stay in the theme. */
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li.am-nav-group {
  box-sizing: border-box;
  padding: 0 !important;
}
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li.am-nav-group > details {
  margin: 0;
  border: 0;
  background: none !important;
}
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li.am-nav-group > details > summary {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 51px;
  margin: 0;
  padding: 10px 30px !important;
  list-style: none;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
}
/* Keep the exact label colours already used by the current sidebar theme. */
html body .wapper .content .automix-main-nav .automix-main-statistics > details > summary > span:not(.am-nav-chevron) {
  color: #9de3ed !important;
  font-weight: 700 !important;
}
html body .wapper .content .automix-main-nav .automix-main-tournaments > a > span {
  color: #f2d18b !important;
  font-weight: 700 !important;
}
html body .automix-main-nav .am-nav-group > details > summary::-webkit-details-marker { display: none; }
html body .automix-main-nav .am-nav-group > details > summary > i {
  display: inline-block;
  flex: 0 0 17px;
  width: 17px;
  margin: 0 !important;
  text-align: center;
}
html body .automix-main-nav .am-nav-group .am-nav-chevron {
  box-sizing: border-box;
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin-left: auto;
  margin-right: 4px;
  border-right: 2.5px solid #e6c878;
  border-bottom: 2.5px solid #e6c878;
  transform: rotate(45deg);
}
html body .automix-main-nav .am-nav-group details[open] > summary .am-nav-chevron { transform: rotate(225deg); }
html body .wapper .content .automix-main-nav .am-nav-group > details > ul {
  position: relative;
  box-sizing: border-box;
  width: calc(100% - 32px);
  margin: 0 0 8px 32px !important;
  padding: 0 !important;
  border-left: 0 !important;
  list-style: none;
  background: none !important;
}
html body .automix-main-nav .am-nav-group > details > ul::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(230,200,120,0), rgba(230,200,120,.66) 22%, rgba(230,200,120,.66) 78%, rgba(230,200,120,0));
  pointer-events: none;
}
html body .automix-main-nav .am-nav-group > details > ul::after { content: none !important; }
/* No frame around the whole branch: only the two dividers around the middle row remain. */
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li:is(#am-stats-nav-group,.am-nav-group.automix-main-statistics[data-am-group="statistics"]) > details > ul > li {
  border-top: 0 !important;
  border-bottom: 0 !important;
}
html body .wapper .content .automix-main-nav .am-nav-group > details > ul > li:nth-child(2) {
  position: relative;
}
html body .automix-main-nav .am-nav-group > details > ul > li:nth-child(2)::before,
html body .automix-main-nav .am-nav-group > details > ul > li:nth-child(2)::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(111,139,165,0), rgba(111,139,165,.22) 18%, rgba(111,139,165,.22) 82%, rgba(111,139,165,0));
  pointer-events: none;
  z-index: 1;
}
html body .automix-main-nav .am-nav-group > details > ul > li:nth-child(2)::before { top: 0; }
html body .automix-main-nav .am-nav-group > details > ul > li:nth-child(2)::after { bottom: 0; }
html body .wapper .content .automix-main-nav .am-nav-group > details > ul > li > a {
  box-sizing: border-box;
  display: flex !important;
  align-items: center !important;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  margin: 0 !important;
  padding: 9px 8px 9px 12px !important;
  font-size: clamp(11px, 3.3vw, 14px) !important;
  white-space: nowrap !important;
}
html body .automix-main-nav .am-nav-group > details > ul > li > a > span:first-child { min-width: 0; white-space: nowrap !important; }
html body .automix-main-nav .am-nav-group > details > ul > li > a > .automix-new-badge { flex: 0 0 auto; margin-left: auto !important; font-size: 11px !important; }

/* The branch itself is a container; only its selected child receives a row gradient. */
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li:is(#am-stats-nav-group,.am-nav-group.automix-main-statistics[data-am-group="statistics"]) {
  background: none !important;
  background-image: none !important;
  box-shadow: none !important;
  border-bottom: 0 !important;
}
/* A soft centre glow fades into the dark sidebar on every edge, without a rectangular end. */
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li:is(#am-stats-nav-group,.am-nav-group.automix-main-statistics[data-am-group="statistics"]) > details > ul > li:is(.active,.selected,:has(> a[aria-current="page"])) {
  background: radial-gradient(ellipse 58% 58% at 50% 50%, rgba(45,91,118,.36) 0%, rgba(27,55,72,.22) 46%, rgba(5,12,22,0) 86%) !important;
}
/* Touch browsers can keep :hover after a tap: never paint the parent as a rectangle. */
html body .wapper .content .automix-main-nav .vertical-navigation > ul > li:is(#am-stats-nav-group,.am-nav-group.automix-main-statistics[data-am-group="statistics"]) > details > summary {
  background: none !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* A slightly wider navigation column keeps every statistics label on one line. */
@media (min-width: 992px) and (max-width: 1199px) {
  html body .wapper .content .row:has(> .col-lg-3 > .automix-main-nav) > .col-lg-3 { width: 30% !important; max-width: 30% !important; flex: 0 0 30% !important; }
  html body .wapper .content .row:has(> .col-lg-3 > .automix-main-nav) > .col-lg-9 { width: 70% !important; max-width: 70% !important; flex: 0 0 70% !important; }
}
@media (min-width: 1200px) {
  html body .wapper .content .row:has(> .col-lg-3 > .automix-main-nav) > .col-lg-3 { width: 28% !important; max-width: 28% !important; flex: 0 0 28% !important; }
  html body .wapper .content .row:has(> .col-lg-3 > .automix-main-nav) > .col-lg-9 { width: 72% !important; max-width: 72% !important; flex: 0 0 72% !important; }
}

/* The common sidebar now contains the statistics links, so the old duplicate menu is hidden. */
html body:has(.automix-main-nav .am-nav-group[data-am-group="statistics"]) .block.extra-stats:has(.automix-stat-type) { display: none !important; }
html body:has(.automix-main-nav .am-nav-group[data-am-group="statistics"]) .automix-mobile-types { display: none !important; }
html body:has(.automix-main-nav .am-nav-group[data-am-group="statistics"]) .automix-main-nav .automix-main-link { display: list-item !important; }

@media (max-width: 991px) {
  html.am-mobile-layout body .wapper .content .automix-main-nav.am-navigation-fold .vertical-navigation > ul > li.am-nav-group > details > summary {
    min-height: 44px;
    padding: 10px 14px !important;
    font-size: 15px !important;
  }
}

/* New ownership switch: use the site's existing button and active palettes. */
html body .automix .am-match-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
html body .automix .am-match-scope > button { min-width: 136px; }
@media (max-width: 650px) {
  html body .automix .am-match-scope { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  html body .automix .am-match-scope > button { min-width: 0; width: 100%; padding: 8px 5px; font-size: clamp(11px,3.1vw,14px); }
}
