.match-filters-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  width: min(462px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  background: #0f141d;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  transform: translate(-50%, -50%);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent;
}

#matchFiltersBackdrop {
  background: rgba(2, 6, 12, 0.72);
  backdrop-filter: blur(4px);
}

.filters-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.filters-title strong {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.filters-title button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.filters-title button:hover,
.filters-title button:focus-visible {
  color: var(--text);
  background: var(--soft);
  outline: 0;
}

.filters-title svg {
  width: 18px;
  height: 18px;
}

.filter-group {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.filter-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #dce4f2;
  background: #171d28;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.filter-choice:hover,
.filter-choice:focus-visible,
.filter-choice:focus-within {
  border-color: var(--line-strong);
  background: #1a212d;
  outline: 0;
}

.filter-choice.sort-switch {
  grid-template-columns: minmax(0, 1fr) 66px 18px;
  padding: 0 12px 0 0;
  cursor: default;
}

.filter-choice.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--green) 52%, var(--line-strong));
  background: color-mix(in srgb, var(--green) 13%, transparent);
}

.filter-choice svg,
.sort-select svg {
  width: 16px;
  height: 16px;
  color: #aeb8c9;
}

.filter-choice b,
.sort-select b {
  color: #aeb8c9;
  font-size: 12px;
  text-transform: uppercase;
}

.filter-choice span,
.sort-select span {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-choice i {
  justify-self: end;
  width: 18px;
  height: 18px;
  border: 1px solid #485368;
  border-radius: 999px;
  background: #111720;
}

.filter-choice.active i {
  border: 5px solid var(--green);
  background: #f8fafc;
}

.sort-select {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 14px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sort-direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  min-width: 58px;
  padding: 0 10px;
  border: 1px solid #475267;
  border-radius: 999px;
  color: #d7deeb;
  background: #202836;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.sort-direction:hover,
.sort-direction:focus-visible {
  border-color: color-mix(in srgb, var(--green) 45%, #667188);
  background: #252f3e;
  outline: 0;
}

.sort-direction svg {
  width: 14px;
  height: 14px;
  color: #6f7a8d;
  transition: color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.sort-direction:not(.desc) .sort-direction-up,
.sort-direction.desc .sort-direction-down {
  color: var(--green);
  opacity: 1;
  transform: scale(1.08);
}

.sort-direction:not(.desc) .sort-direction-down,
.sort-direction.desc .sort-direction-up {
  opacity: 0.55;
}

.country-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #171d28;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.country-search:focus-within {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line-strong));
  background: #1a212d;
}

.country-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.country-search input::placeholder {
  color: #7e899b;
}

.country-search svg {
  width: 18px;
  height: 18px;
  color: #909aac;
}

.country-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.country-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #dce4f2;
  background: #171d28;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.country-chip:hover,
.country-chip:focus-visible {
  border-color: var(--line-strong);
  background: #1a212d;
  outline: 0;
}

.country-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-flag {
  display: grid;
  place-items: center;
  width: 24px;
  height: 18px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.country-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.country-flag.fallback {
  border-radius: 999px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}

.country-flag.fallback svg {
  width: 13px;
  height: 13px;
}

.country-chip.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--green) 56%, var(--line-strong));
  background: color-mix(in srgb, var(--green) 24%, var(--panel));
}

.country-chip svg {
  width: 13px;
  height: 13px;
}

.show-more-countries {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #aeb7c8;
  background: #171d28;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.show-more-countries:hover,
.show-more-countries:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  background: #1a212d;
  outline: 0;
}

.show-more-countries svg {
  width: 16px;
  height: 16px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  margin-top: 4px;
  padding-top: 2px;
}

.filter-actions button {
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--green) 56%, var(--line-strong));
  border-radius: 9px;
  color: #06130f;
  background: var(--green);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.filter-actions button:hover,
.filter-actions button:focus-visible {
  border-color: color-mix(in srgb, var(--green) 72%, var(--line-strong));
  background: color-mix(in srgb, var(--green) 86%, white);
  outline: 0;
}

.filter-actions .secondary {
  color: #e7ebf4;
  background: #171d28;
  border-color: var(--line);
}

.filter-actions .secondary:hover,
.filter-actions .secondary:focus-visible {
  border-color: var(--line-strong);
  background: #1d2532;
}
