/* Search popup (header search button): opens below the header, covers the page. */
.fl-search {
	position: fixed;
	inset: 65px 0 0;
	z-index: 1000;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #f3f6fa;
	color: #071a2b;
	animation: fl-search-in 0.16s ease-out;
}
.fl-search[hidden] { display: none; }
@keyframes fl-search-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.fl-search *, .fl-search *::before, .fl-search *::after { box-sizing: border-box; }

.fl-search__inner { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 24px; }
.fl-search__inner--wide { max-width: 920px; }
.fl-search__head .fl-search__inner { max-width: 690px; }

/* Search results page (/search/?s=…): same look, in the page flow. */
.fl-search-page { min-height: 70vh; background: #f3f6fa; color: #071a2b; }
.fl-search-page *, .fl-search-page *::before, .fl-search-page *::after { box-sizing: border-box; }
a.fl-search__tab, a.fl-search__more { text-decoration: none; }
html[data-theme="dark"] .fl-search-page { background: #07111c; color: #eef3f8; }

/* Top band with the field. */
.fl-search__head { padding: 30px 0 24px; border-bottom: 1px solid #e6ebf1; background: #fff; }
.fl-search__label { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; color: #168cff; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.fl-search__row { display: flex; align-items: center; gap: 10px; }
.fl-search__form {
	position: relative;
	display: flex;
	flex: 1;
	align-items: center;
	min-height: 54px;
	padding: 0 16px;
	border: 1px solid #cdd6e1;
	border-radius: 16px;
	background: #f3f6fa;
}
.fl-search__form:focus-within { border-color: #168cff; background: #fff; box-shadow: 0 0 0 4px rgba(22, 140, 255, 0.14); }
.fl-search__icon { margin-right: 12px; color: #8b98aa; font-size: 15px; }
.fl-search__input { flex: 1; min-width: 0; border: 0; background: transparent; color: #071a2b; font: inherit; font-size: 15px; font-weight: 500; outline: none; }
.fl-search__input::placeholder { color: #8b98aa; }
.fl-search__input::-webkit-search-cancel-button { display: none; }
.fl-search__clear,
.fl-search__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border: 0;
	color: #6f7f93;
	cursor: pointer;
}
.fl-search__clear { width: 26px; height: 26px; margin-left: 8px; border-radius: 50%; background: #e3e9f0; font-size: 12px; }
.fl-search__clear[hidden] { display: none; }
.fl-search__close { width: 44px; height: 44px; border: 1px solid #e3e9f0; border-radius: 50%; background: #fff; font-size: 16px; }
.fl-search__clear:hover, .fl-search__close:hover { color: #168cff; }
/* Close button beside the field on every screen size (Esc also closes). */
.fl-search__spinner { width: 16px; height: 16px; margin-left: 8px; border: 2px solid #d6e6f8; border-top-color: #168cff; border-radius: 50%; animation: fl-spin 0.7s linear infinite; }
.fl-search__spinner[hidden] { display: none; }
@keyframes fl-spin { to { transform: rotate(360deg); } }
.fl-search__hint { margin: 10px 2px 0; color: #94a2b4; font-size: 12px; }
.fl-search__hint[hidden] { display: none; }

/* Content area. */
.fl-search__body { padding: 26px 0 56px; }
.fl-search__section + .fl-search__section { margin-top: 28px; }
.fl-search__section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fl-search__section-title { margin: 0; color: #8292a6; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.fl-search__more { padding: 0; border: 0; background: none; color: #168cff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.fl-search__more i { margin-left: 4px; font-size: 9px; }
.fl-search__summary { margin: 0 0 22px; color: #8292a6; font-size: 12px; }
.fl-search__summary strong { color: #071a2b; }
.fl-search__empty { margin: 36px 0; color: #8292a6; font-size: 14px; text-align: center; }

.fl-search__card { border: 1px solid #e3e9f0; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(7, 26, 43, 0.045); color: #071a2b; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.fl-search__card:hover, a.fl-search__card:focus-visible { border-color: #bcdcff; box-shadow: 0 10px 24px rgba(22, 140, 255, 0.12); outline: none; }
.fl-search__grid { display: grid; gap: 12px; }
.fl-search__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fl-search__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fl-search__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fl-search__grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.fl-search__img { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background: #eef3f8; color: #9aa7b8; }
.fl-search__img img { width: 100%; height: 100%; object-fit: cover; }
.fl-search__img--crest { background: transparent; }
.fl-search__img--crest img { object-fit: contain; }
.fl-search__img.fl-search__img--crest.fl-search__img--crest { border-radius: 0; overflow: visible; }
.fl-search__name { display: block; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.fl-search__name mark { background: transparent; color: inherit; }
.fl-search__meta { display: block; overflow: hidden; margin-top: 3px; color: #94a2b4; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

/* Recent searches. */
.fl-search__recent { display: grid; gap: 2px; }
.fl-search__recent-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: #071a2b; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; background: none; border: 0; text-align: left; font-family: inherit; }
.fl-search__recent-item i { color: #9aa7b8; font-size: 12px; }
.fl-search__recent-item:hover, .fl-search__recent-item:focus-visible { background: #fff; outline: none; }
.fl-search__clear-recent { padding: 0; border: 0; background: none; color: #94a2b4; font: inherit; font-size: 11px; cursor: pointer; }

/* Trending. */
.fl-search__trend { display: flex; align-items: center; gap: 16px; min-height: 58px; padding: 12px 18px; border-radius: 18px; }
.fl-search__trend-rank { width: 14px; flex-shrink: 0; color: #168cff; font-size: 16px; font-weight: 800; text-align: center; }
.fl-search__trend-rank--muted { color: #c2ccd8; }
.fl-search__trend .fl-search__name { font-size: 13px; }
.fl-search__trend .fl-search__meta { margin-top: 2px; }
.fl-search__trend-text { flex: 1; min-width: 0; }
.fl-search__trend > i { color: #168cff; font-size: 12px; }

/* Popular players / clubs. */
.fl-search__pop { display: flex; flex-direction: column; align-items: center; padding: 18px 12px 16px; text-align: center; }
.fl-search__pop .fl-search__img { width: 46px; height: 46px; margin-bottom: 10px; border-radius: 50%; }
.fl-search__pop .fl-search__name, .fl-search__pop .fl-search__meta { max-width: 100%; }
.fl-search__rating { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: #168cff; font-size: 14px; font-weight: 800; }
.fl-search__trend-badge { padding: 2px 6px; border-radius: 999px; background: #e7f8ee; color: #20b964; font-size: 9px; font-weight: 800; }
.fl-search__trend-badge--down { background: #fdecee; color: #ef4652; }
.fl-search__views { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
.fl-search__views i { font-size: 10px; }
.fl-search__club { display: flex; flex-direction: column; align-items: center; padding: 16px 8px 14px; text-align: center; }
.fl-search__club .fl-search__img { width: 38px; height: 38px; margin-bottom: 10px; }
.fl-search__club .fl-search__name { max-width: 100%; font-size: 12px; }

/* Tabs. */
.fl-search__tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.fl-search__tabs::-webkit-scrollbar { display: none; }
.fl-search__tab { display: inline-flex; flex-shrink: 0; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 1px solid #e3e9f0; border-radius: 999px; background: #fff; color: #4f5f73; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.fl-search__tab i { font-size: 11px; }
.fl-search__tab span { padding: 1px 7px; border-radius: 999px; background: #eef2f6; color: #6f7f93; font-size: 10px; }
.fl-search__tab[aria-pressed="true"] { border-color: #071a2b; background: #071a2b; color: #fff; }
.fl-search__tab[aria-pressed="true"] span { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* Result cards. */
.fl-search__player { display: flex; align-items: center; gap: 12px; padding: 12px; }
.fl-search__player .fl-search__img { width: 44px; height: 44px; border-radius: 10px; }
.fl-search__player-text { flex: 1; min-width: 0; }
.fl-search__ga { display: flex; gap: 10px; margin-top: 4px; font-size: 11px; font-weight: 800; }
.fl-search__ga .g { color: #20b964; }
.fl-search__ga .a { color: #168cff; }
.fl-search__big { flex-shrink: 0; text-align: right; }
.fl-search__big strong { display: block; color: #168cff; font-size: 20px; font-weight: 800; line-height: 1; }
.fl-search__big small { display: block; margin-top: 4px; color: #94a2b4; font-size: 10px; }
.fl-search__team { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.fl-search__team .fl-search__img { width: 42px; height: 42px; }
.fl-search__team .fl-search__big strong { color: #071a2b; }
.fl-search__match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 16px; }
.fl-search__chip { justify-self: start; max-width: 100%; overflow: hidden; padding: 4px 10px; border: 1px solid #e1e7ee; border-radius: 999px; background: #f1f4f8; color: #5f6f84; font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.fl-search__fixture { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.fl-search__fixture .fl-search__img { width: 22px; height: 22px; }
.fl-search__score { display: inline-flex; justify-content: center; gap: 2px; min-width: 54px; color: #071a2b; font-size: 18px; font-weight: 800; text-align: center; }
.fl-search__score--vs { color: #94a2b4; font-size: 12px; }
.fl-search__score--live { color: #ef4652; }
.fl-search__when { justify-self: end; color: #94a2b4; font-size: 11px; text-align: right; }
.fl-search__when--live { color: #ef4652; font-weight: 800; }
.fl-search__news { display: flex; align-items: center; gap: 14px; padding: 10px; }
.fl-search__news .fl-search__img { width: 64px; height: 64px; border-radius: 12px; }
.fl-search__news .fl-search__chip { display: inline-block; margin-bottom: 6px; }
.fl-search__news .fl-search__name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fl-search__league { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.fl-search__league .fl-search__img { width: 34px; height: 34px; }

@media (max-width: 900px) {
	.fl-search__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.fl-search__grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.fl-search__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.fl-search__inner { padding: 0 16px; }
	.fl-search__head { padding: 20px 0 18px; }
	.fl-search__grid--2, .fl-search__grid--3 { grid-template-columns: 1fr; }
	.fl-search__grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Match row: competition | crest, stacked score, crest | time (team names hidden). */
	.fl-search__match { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; min-height: 96px; padding: 16px; border-radius: 18px; }
	.fl-search__match .fl-search__chip { padding: 6px 12px; white-space: normal; line-height: 1.3; }
	.fl-search__team-name { display: none; }
	.fl-search__fixture { gap: 18px; }
	.fl-search__fixture .fl-search__img { width: 24px; height: 24px; }
	.fl-search__score { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 22px; font-size: 18px; line-height: 1; }
	.fl-search__score-dash { font-size: 16px; line-height: 0.6; }
	.fl-search__when { font-size: 11px; }
	.fl-search__score--vs { font-size: 12px; }
	.fl-search__news .fl-search__img { width: 72px; height: 72px; }
}

html[data-theme="dark"] .fl-search { background: #07111c; color: #eef3f8; }
html[data-theme="dark"] .fl-search__head { border-color: rgba(255, 255, 255, 0.08); background: #0b1826; }
html[data-theme="dark"] .fl-search__form { border-color: rgba(255, 255, 255, 0.12); background: #0f2133; }
html[data-theme="dark"] .fl-search__input,
html[data-theme="dark"] .fl-search__card,
html[data-theme="dark"] .fl-search__recent-item,
html[data-theme="dark"] .fl-search__score,
html[data-theme="dark"] .fl-search__team .fl-search__big strong,
html[data-theme="dark"] .fl-search__summary strong { color: #eef3f8; }
html[data-theme="dark"] .fl-search__card,
html[data-theme="dark"] .fl-search__tab,
html[data-theme="dark"] .fl-search__close { border-color: rgba(255, 255, 255, 0.1); background: #0f2133; box-shadow: none; }
html[data-theme="dark"] .fl-search__tab { color: #b6c1cd; }
html[data-theme="dark"] .fl-search__recent-item:hover { background: #0f2133; }
html[data-theme="dark"] .fl-search__img,
html[data-theme="dark"] .fl-search__chip,
html[data-theme="dark"] .fl-search__clear { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .fl-search__img--crest { background: transparent; }
