/* V290 — active-state specificity hardening.
   V288 established the approved visual language, but a few legacy selectors
   (notably V281 player tabs and button-system.css button.*.active rules) had
   higher specificity and could still win despite loading earlier.
   This layer intentionally adds one harmless specificity guard so the approved
   selected state is actually rendered everywhere. */
:root{
  --fm-selected-a:#aad7bb;
  --fm-selected-b:#cde6d7;
  --fm-selected-c:#f0f7f2;
  --fm-selected-text:#102319;
  --fm-selected-shadow:0 2px 8px rgba(39,104,65,.055);
}

/* The :not(.fm-v290-disable) guard raises specificity without changing normal
   matching. This is deliberate: old page-specific !important rules otherwise
   beat the shared V288 layer. */
html body:not(.fm-v290-disable) .menu a.active,
html body:not(.fm-v290-disable) .main-nav a.active,
html body:not(.fm-v290-disable) .game-top-nav a.active,
html body:not(.fm-v290-disable) .subnav a.active,
html body:not(.fm-v290-disable) .competition-nav > a.active,
html body:not(.fm-v290-disable) .player-tabs .tab-btn.active,
html body:not(.fm-v290-disable) .tactic-tabs .tab-btn.active,
html body:not(.fm-v290-disable) button.tab-btn.active,
html body:not(.fm-v290-disable) a.tab-btn.active,
html body:not(.fm-v290-disable) button.filter-btn.active,
html body:not(.fm-v290-disable) .filter-btn.active,
html body:not(.fm-v290-disable) .stats-tab.active,
html body:not(.fm-v290-disable) .stats-kind.active,
html body:not(.fm-v290-disable) button.nav-btn.active,
html body:not(.fm-v290-disable) .nav-btn.active,
html body:not(.fm-v290-disable) .tour-tab.active,
html body:not(.fm-v290-disable) .calendar-tab.active,
html body:not(.fm-v290-disable) .comp-tab.active,
html body:not(.fm-v290-disable) button.country-btn.active,
html body:not(.fm-v290-disable) .country-btn.active,
html body:not(.fm-v290-disable) button.country-pill.active,
html body:not(.fm-v290-disable) .country-pill.active,
html body:not(.fm-v290-disable) .country-toolbar button.active,
html body:not(.fm-v290-disable) button.league-btn.active,
html body:not(.fm-v290-disable) .league-btn.active,
html body:not(.fm-v290-disable) button.small-btn.active,
html body:not(.fm-v290-disable) .small-btn.active,
html body:not(.fm-v290-disable) button.speed-choice.active,
html body:not(.fm-v290-disable) .speed-choice.active,
html body:not(.fm-v290-disable) .transfer-tab.active,
html body:not(.fm-v290-disable) .folder.active,
html body:not(.fm-v290-disable) .application-select-grid button.active,
html body:not(.fm-v290-disable) button.selected,
html body:not(.fm-v290-disable) .manager-avatar-choice.selected,
html body:not(.fm-v290-disable) .portrait-choice.selected,
html body:not(.fm-v290-disable) [role="tab"][aria-selected="true"],
html body:not(.fm-v290-disable) button[aria-pressed="true"],
html body:not(.fm-v290-disable) a[aria-current="page"]{
  background:linear-gradient(90deg,var(--fm-selected-a) 0%,var(--fm-selected-b) 58%,var(--fm-selected-c) 100%)!important;
  color:var(--fm-selected-text)!important;
  -webkit-text-fill-color:var(--fm-selected-text)!important;
  border:1px solid transparent!important;
  outline:0!important;
  box-shadow:var(--fm-selected-shadow)!important;
  text-shadow:none!important;
  transform:none!important;
  filter:none!important;
}

html body:not(.fm-v290-disable) .tab-btn.active *,
html body:not(.fm-v290-disable) .filter-btn.active *,
html body:not(.fm-v290-disable) .stats-tab.active *,
html body:not(.fm-v290-disable) .stats-kind.active *,
html body:not(.fm-v290-disable) .nav-btn.active *,
html body:not(.fm-v290-disable) .tour-tab.active *,
html body:not(.fm-v290-disable) .calendar-tab.active *,
html body:not(.fm-v290-disable) .comp-tab.active *,
html body:not(.fm-v290-disable) .country-btn.active *,
html body:not(.fm-v290-disable) .country-pill.active *,
html body:not(.fm-v290-disable) .league-btn.active *,
html body:not(.fm-v290-disable) .small-btn.active *,
html body:not(.fm-v290-disable) .speed-choice.active *,
html body:not(.fm-v290-disable) .transfer-tab.active *,
html body:not(.fm-v290-disable) [role="tab"][aria-selected="true"] *,
html body:not(.fm-v290-disable) button[aria-pressed="true"] *{
  color:var(--fm-selected-text)!important;
  -webkit-text-fill-color:var(--fm-selected-text)!important;
  text-shadow:none!important;
}

/* V281 used both an inset green bottom shadow and ::after underline here. */
html body.player-page:not(.fm-v290-disable) .player-tabs .tab-btn.active{
  background:linear-gradient(90deg,var(--fm-selected-a) 0%,var(--fm-selected-b) 58%,var(--fm-selected-c) 100%)!important;
  color:var(--fm-selected-text)!important;
  -webkit-text-fill-color:var(--fm-selected-text)!important;
  border:1px solid transparent!important;
  box-shadow:var(--fm-selected-shadow)!important;
  transform:none!important;
}
html body.player-page:not(.fm-v290-disable) .player-tabs .tab-btn.active::after{
  content:none!important;
  display:none!important;
  background:transparent!important;
  box-shadow:none!important;
}

/* Preserve the semantic exception from V288: active means "upgrade available". */
html body.training-page:not(.fm-v290-disable) .attrs-area .up-btn.active,
html body.training-page:not(.fm-v290-disable) .attrs-area .up-btn.active:hover{
  width:16px!important;
  min-width:16px!important;
  height:18px!important;
  min-height:18px!important;
  padding:0!important;
  border-radius:5px!important;
  background:linear-gradient(135deg,#a8ddbb,#eff9f3)!important;
  border:1px solid #9bd0ad!important;
  color:#174e2d!important;
  -webkit-text-fill-color:#174e2d!important;
  box-shadow:none!important;
  transform:none!important;
}
