/*
 * Top bar (layout/header.php): logo, Players (+ scouting), Teams, Leagues, Squad builder, Squads, the site search and
 * language / dark mode / currency / login. Below 1200px: logo, search and the menu button (side menu, #sidenav-1).
 * Also the search dropdown shared with the home page hero (.home-search-menu, js/site-search.js).
 */
/* colours: the bar and the side menu (outside the bar) */
.fcm-bar-wrap,
.fcm-side {
  --bar-bg: #16153d;
  --bar-field: #1f1e4d;
  --bar-pop: #1a1a40;
  --bar-line: rgba(255, 255, 255, 0.1);
  --bar-fg: rgba(255, 255, 255, 0.82);
  --bar-fg-2: rgba(255, 255, 255, 0.55);
  --bar-accent: #5cf8db;
  --bar-ink: #0b1d1a;
}
.fcm-bar-wrap {
  position: relative;
  z-index: 1030;
  background: transparent !important; /* the old header rules colour <header> */
}
.site-dark-skin .fcm-bar-wrap,
.site-dark-skin .fcm-side {
  --bar-bg: #111;
  --bar-field: #1c1c1c;
  --bar-pop: #1c1c1c;
}
.fcm-bar {
  background: var(--bar-bg);
  border-bottom: 1px solid var(--bar-line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.fcm-bar-in {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}
.fcm-bar-logo {
  display: inline-flex;
  flex: none;
  align-items: center;
}
.fcm-bar-logo img {
  width: 42px;
  height: auto;
}

/* nav links */
.fcm-bar-nav {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}
.fcm-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--bar-fg);
  background: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.fcm-bar-link:hover,
.fcm-bar-link:focus-visible,
.fcm-dd.open > .fcm-bar-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}
.fcm-bar-link.active {
  color: var(--bar-accent);
}
.fcm-caret {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.15s;
}
.fcm-dd.open .fcm-caret {
  transform: rotate(180deg);
}

/* dropdowns (Players, language, currency, account) */
.fcm-dd {
  position: relative;
}
.fcm-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1040;
  display: none;
  min-width: 210px;
  padding: 6px;
  background: var(--bar-pop);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.fcm-dd-menu::before {
  /* hover bridge over the gap above the menu */
  content: "";
  position: absolute;
  top: -10px;
  right: 0;
  left: 0;
  height: 10px;
}
.fcm-dd.open > .fcm-dd-menu {
  display: block;
}
.fcm-dd-right {
  right: 0;
  left: auto;
}
.fcm-dd-scroll {
  max-height: min(420px, 70vh);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 248, 219, 0.45) transparent;
}
.fcm-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--bar-fg);
  border-radius: 8px;
  cursor: pointer;
}
.fcm-dd-item i {
  width: 16px;
  text-align: center;
  color: var(--bar-accent);
  opacity: 0.85;
}
.fcm-dd-item:hover,
.fcm-dd-item:focus-visible {
  color: #fff;
  background: rgba(92, 248, 219, 0.12);
  outline: none;
}
.fcm-dd-item.active {
  color: var(--bar-accent);
}
.fcm-dd-main {
  font-weight: 700;
  color: #fff;
}
.fcm-dd-danger i,
.fcm-dd-danger {
  color: #ff7a93;
}
.fcm-dd-label {
  display: block;
  margin: 6px 10px 2px;
  padding-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bar-fg-2);
  border-top: 1px solid var(--bar-line);
}
.fcm-dd-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fcm-dd-radio b,
.fcm-bar-tool b {
  min-width: 14px;
  color: var(--bar-accent);
  text-align: center;
}

/* search: the home page search, in the bar */
/* right after the logo, before the menu items */
.fcm-bar-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 400px;
}
.fcm-bar-search > i {
  position: absolute;
  top: 50%;
  left: 14px;
  font-size: 14px;
  color: var(--bar-fg-2);
  transform: translateY(-50%);
  pointer-events: none;
}
.fcm-bar-search.is-loading > i::before {
  content: "\f1ce"; /* circle-notch */
  display: inline-block;
  animation: fa-spin 0.8s linear infinite;
}
#fcm-bar-search {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  font-size: 14px;
  color: #fff;
  background: var(--bar-field);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#fcm-bar-search::placeholder {
  color: var(--bar-fg-2);
}
#fcm-bar-search:focus {
  border-color: rgba(92, 248, 219, 0.8);
  box-shadow: 0 0 0 3px rgba(92, 248, 219, 0.16);
}

/* right side: language, dark mode, currency, login / account */
.fcm-bar-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.fcm-bar-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--bar-fg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bar-line);
  border-radius: 9px;
  cursor: pointer;
}
.fcm-bar-tool:hover,
.fcm-bar-tool:focus-visible,
.fcm-dd.open > .fcm-bar-tool {
  color: #fff;
  border-color: rgba(92, 248, 219, 0.45);
  outline: none;
}
.fcm-bar-tool .flag {
  margin: 0 !important;
}
.fcm-bar-user span {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fcm-bar-user > i:first-child {
  font-size: 16px;
  color: var(--bar-accent);
}
.fcm-bar-login {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--bar-ink) !important;
  background: var(--bar-accent);
  border-radius: 9px;
}
.fcm-bar-login:hover,
.fcm-bar-login:focus {
  color: var(--bar-ink);
  filter: brightness(1.08);
}

/* dark mode switch: sun / moon track */
.fcm-theme {
  position: relative;
  display: inline-flex;
  flex: none;
  margin: 0;
  cursor: pointer;
}
.fcm-theme input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fcm-theme-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 54px;
  height: 28px;
  padding: 0 7px;
  font-size: 11px;
  color: var(--bar-fg-2);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--bar-line);
  border-radius: 14px;
}
.fcm-theme-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--bar-accent);
  border-radius: 50%;
  transition: transform 0.18s;
}
.fcm-theme input:checked + .fcm-theme-track::after {
  transform: translateX(26px);
}
.fcm-theme input:focus-visible + .fcm-theme-track {
  border-color: var(--bar-accent);
}

/* menu button (below 1200px) */
.fcm-bar-burger {
  display: none;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bar-line);
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 1199.98px) {
  /* the bar stays at the top while the page scrolls (plain CSS: the old sticky-header script switched it between
     fixed and static on every scroll direction change, so taps on the menu button / search could miss) */
  .fcm-bar-wrap {
    position: sticky;
    top: 0;
  }
  /* body has .h-100 (height: 100%), which would end the sticky bar after one screen: let it grow with the page */
  body.h-100 {
    height: auto !important;
    min-height: 100%;
  }
  .fcm-bar-nav,
  .fcm-bar-tools {
    display: none;
  }
  .fcm-bar-burger {
    display: grid;
  }
  .fcm-bar-in {
    gap: 12px;
    height: 58px;
  }
  .fcm-bar-search {
    max-width: none;
    min-width: 0;
  }
}
@media (max-width: 575.98px) {
  .fcm-bar-in {
    gap: 10px;
    padding-right: 12px;
    padding-left: 12px;
  }
  .fcm-bar-logo img {
    width: 36px;
  }
  #fcm-bar-search {
    font-size: 16px; /* 16px stops iOS zooming in */
  }
}
/* side menu open (js/site-bar.js): the page behind it doesn't scroll, the menu scrolls on its own */
html.fcm-side-open,
html.fcm-side-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.fcm-side.sidenav {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* side menu (below 1200px) */
.fcm-side.sidenav {
  background: #16153d !important;
}
.site-dark-skin .fcm-side.sidenav {
  background: #111 !important;
}
.fcm-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.fcm-side-user {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
}
.fcm-side-user i {
  color: #5cf8db;
}
.fcm-side .fcm-side-menu .sidenav-link {
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82) !important;
}
.fcm-side .fcm-side-menu .sidenav-link i {
  width: 18px;
  text-align: center;
  color: #5cf8db;
}
.fcm-side .fcm-side-menu .sidenav-link.active {
  color: #5cf8db !important;
}
.fcm-side .fcm-side-menu .sidenav-collapse .sidenav-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7) !important;
}
.fcm-side-settings {
  margin-top: 8px;
  padding: 12px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.fcm-side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
}
.fcm-side-row-stack {
  flex-direction: column;
  align-items: flex-start;
}
.fcm-side-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.fcm-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
}
.fcm-seg label {
  margin: 0;
  padding: 4px 7px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  cursor: pointer;
}
.fcm-seg label.active {
  color: #0b1d1a;
  background: #5cf8db;
}
.fcm-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------- bottom bar (layout/footer.php): copyright, TOS + privacy, social links ---------- */
.fcm-foot {
  margin-top: 40px;
  color: rgba(255, 255, 255, 0.6);
  background: #16153d;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.site-dark-skin .fcm-foot {
  background: #111;
}
.fcm-foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.fcm-foot-copy {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 13px;
}
.fcm-foot-logo img {
  width: 32px;
  height: auto;
  opacity: 0.85;
}
.fcm-foot a {
  color: rgba(255, 255, 255, 0.82);
}
.fcm-foot a:hover,
.fcm-foot a:focus-visible {
  color: #5cf8db;
}
.fcm-foot-links {
  display: flex;
  gap: 18px;
  font-size: 13px;
  font-weight: 600;
}
.fcm-foot-social {
  display: flex;
  gap: 8px;
}
.fcm-foot-social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: border-color 0.15s, color 0.15s;
}
.fcm-foot-social a:hover,
.fcm-foot-social a:focus-visible {
  border-color: rgba(92, 248, 219, 0.5);
}
.fcm-foot .footer-extra:empty,
.fcm-foot .footer-extra:has(> template:only-child) {
  display: none;
}
@media (max-width: 767.98px) {
  /* phones: centred, one item per row */
  .fcm-foot-in {
    flex-direction: column;
    text-align: center;
  }
  .fcm-foot-copy {
    flex-direction: column;
    gap: 8px;
  }
}

/* ---------- search dropdown (bar + home hero): pills + grouped Players / Teams / Leagues ---------- */
.ui-autocomplete.home-search-menu {
  z-index: 1050 !important;
  margin-top: 8px;
  padding: 0 0 6px !important;
  max-height: 470px !important;
  overflow-y: auto;
  background: #1a1a40;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 248, 219, 0.45) transparent;
}
.site-dark-skin .ui-autocomplete.home-search-menu {
  background: #1c1c1c;
}
@media (max-width: 992px) {
  /* the old site rule makes every dropdown full width from the left edge; keep this one next to the bar */
  .ui-autocomplete.home-search-menu {
    max-height: min(470px, 75vh) !important;
  }
}
.home-search-menu::-webkit-scrollbar {
  width: 8px;
}
.home-search-menu::-webkit-scrollbar-track {
  margin: 12px 0;
  background: transparent;
}
.home-search-menu::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(92, 248, 219, 0.35);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.home-search-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 248, 219, 0.7);
  background-clip: padding-box;
}
.home-search-menu .home-search-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: inherit;
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.home-search-menu .hs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  cursor: pointer;
}
.home-search-menu .hs-pill i {
  font-size: 11px;
  opacity: 0.8;
}
.home-search-menu .hs-pill span {
  padding: 0 6px;
  font-size: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}
.home-search-menu .hs-pill:hover {
  color: #fff;
  border-color: rgba(92, 248, 219, 0.5);
}
.home-search-menu .hs-pill.active {
  color: #0b1d1a;
  background: #5cf8db;
  border-color: #5cf8db;
}
.home-search-menu .hs-pill.active span {
  color: #0b1d1a;
  background: rgba(0, 0, 0, 0.14);
}
.home-search-menu .home-search-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5cf8db;
  cursor: default;
}
.home-search-menu .home-search-group span {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}
.home-search-menu .hs-item {
  padding: 0 6px !important;
  border: 0 !important;
  background: transparent !important;
}
.home-search-menu .hs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.home-search-menu .hs-item .ui-state-active,
.home-search-menu .hs-item .ui-state-focus,
.home-search-menu .hs-item.ui-state-active .hs-row,
.home-search-menu .hs-item.ui-state-focus .hs-row {
  /* no :hover here: jQuery UI moves the active row on mouseenter, and with autoFocus a :hover rule lit a second row */
  background: rgba(92, 248, 219, 0.14);
  box-shadow: inset 3px 0 0 #5cf8db;
}
.home-search-menu .hs-img {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.home-search-menu .hs-img-player {
  --club: 92, 248, 219;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: radial-gradient(circle at 50% 65%, rgba(var(--club), 0.55) 0%, rgba(var(--club), 0.15) 55%, rgba(var(--club), 0) 72%), rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 10px rgba(var(--club), 0.3);
}
.home-search-menu .hs-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  color: #fff;
}
.home-search-menu .hs-name strong {
  font-weight: 700;
  color: #5cf8db;
}
.home-search-menu .hs-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}
.home-search-menu .hs-mini {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.home-search-menu .hs-flag {
  height: 12px;
  border-radius: 2px;
}
/* same treatment as the OVR on the player cards (.hpc-ovr) */
.home-search-menu .hs-ovr {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 30px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}
.home-search-menu .hs-ovr-lbl {
  margin-top: 1px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.65;
}

/* page background on phones / tablets: site.css paints it on body with background-attachment: fixed + cover, which
   mobile browsers re-size when the address bar hides on a fast scroll, so the image jumped up and the dark fallback
   colour showed at the bottom. Here the image sits on a fixed layer as tall as the largest viewport (lvh, the bar
   hidden), so it never re-sizes; body keeps only the colour, seen on overscroll. */
@media (max-width: 992px) {
  body.fifa-skin,
  body.site-dark-skin {
    background: #25245b !important;
  }
  body.site-dark-skin {
    background: #212121 !important;
  }
  body.fifa-skin::before,
  body.site-dark-skin::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: -1;
    height: 100vh;
    height: 100lvh;
    background: url(/static/img/fifa21_bg_purple_mobile.webp) center top / cover no-repeat;
    pointer-events: none;
  }
  body.site-dark-skin::before {
    background-image: url(/static/img/fifa21_bg_bw_mobile.webp);
  }
}
