/* FL Sport Stats — styled to the flsport.gy design language:
   black / charcoal, FL orange accent, Prompt headings, Roboto text, square corners. */

.fls {
	--fls-accent: var(--e-global-color-0ca11d5, #f99127);
	--fls-accent-dark: #e07b12;
	--fls-ink: var(--e-global-color-7538ba6, #000);
	--fls-charcoal: var(--e-global-color-60cbbc3, #25242b);
	--fls-charcoal-2: var(--e-global-color-8a197b3, #2f2d37);
	--fls-muted: var(--e-global-color-d6105fb, #666);
	--fls-soft: var(--e-global-color-aaa7bbb, #f3f3f3);
	--fls-line: #e6e6e6;
	--fls-white: #fff;
	--fls-head: var(--e-global-typography-primary-font-family, "Prompt"), "Prompt", system-ui, sans-serif;
	--fls-text: var(--e-global-typography-text-font-family, "Roboto"), "Roboto", system-ui, sans-serif;

	font-family: var(--fls-text);
	color: var(--fls-ink);
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}
.fls *,
.fls *::before,
.fls *::after { box-sizing: inherit; }

.fls-title,
.fls-heading {
	font-family: var(--fls-head);
	font-weight: 500;
	text-transform: uppercase;
	text-align: center;
	font-size: clamp(24px, 3vw, 32px);
	letter-spacing: .01em;
	margin: 0 0 24px;
	color: var(--fls-ink);
}
.fls-section + .fls-section { margin-top: 56px; }

/* ---------- Tabs ---------- */
.fls-tabs {
	display: flex;
	gap: 0;
	background: var(--fls-charcoal);
	overflow-x: auto;
	scrollbar-width: none;
}
.fls-tabs::-webkit-scrollbar { display: none; }
.fls-tab {
	flex: 1 1 0;
	min-width: max-content;
	text-align: center;
	padding: 16px 22px;
	font-family: var(--fls-head);
	font-weight: 500;
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: rgba(255,255,255,.75);
	text-decoration: none;
	border-bottom: 3px solid transparent;
	transition: color .15s, border-color .15s, background-color .15s;
}
.fls-tab:hover,
.fls-tab:focus-visible { color: #fff; background: var(--fls-charcoal-2); }
.fls-tab.is-active { color: var(--fls-accent); border-bottom-color: var(--fls-accent); background: var(--fls-charcoal-2); }

/* ---------- Controls ---------- */
.fls-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
	padding: 16px;
	background: var(--fls-soft);
	border: 1px solid var(--fls-line);
	border-top: 0;
}
.fls-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.fls-field-search { flex: 1 1 220px; max-width: 340px; }
.fls-field-label {
	font-family: var(--fls-head);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--fls-muted);
}
.fls .fls-select,
.fls .fls-search {
	height: 42px;
	padding: 0 12px;
	font: inherit;
	font-size: 15px;
	color: var(--fls-ink);
	background: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 0;
	min-width: 180px;
	width: 100%;
	box-shadow: none;
}
.fls .fls-select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23F99127' stroke-width='2' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	cursor: pointer;
}
.fls .fls-select:focus,
.fls .fls-search:focus { outline: 2px solid var(--fls-accent); outline-offset: -1px; border-color: var(--fls-accent); }
.fls-count {
	margin: 0 0 0 auto;
	font-size: 14px;
	color: var(--fls-muted);
	align-self: center;
}

/* ---------- Table ---------- */
.fls-table-wrap {
	position: relative;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--fls-line);
	border-top: 0;
	background: #fff;
	transition: opacity .15s;
}
/* Loading: keep the current table in place, fade it and show a spinner. */
.fls.is-loading .fls-table-wrap,
.fls.is-loading .fls-tabs,
.fls.is-loading .fls-controls { pointer-events: none; }
.fls-table-wrap::before,
.fls-table-wrap::after,
.fls-cards::before,
.fls-cards::after { content: none; }
.fls.is-loading .fls-table-wrap { min-height: 220px; }
.fls.is-loading .fls-table-wrap::before,
.fls-highlights.is-loading .fls-cards::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	background: rgba(255,255,255,.72);
	backdrop-filter: blur(1px);
}
.fls.is-loading .fls-table-wrap::after,
.fls-highlights.is-loading .fls-cards::after {
	content: "";
	position: absolute;
	z-index: 6;
	top: min(50%, 150px);
	left: 50%;
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	border: 3px solid rgba(249,145,39,.22);
	border-top-color: var(--fls-accent);
	border-radius: 50%;
	animation: fls-spin .7s linear infinite;
}
.fls-highlights.is-loading .fls-cards::after { top: 50%; }
.fls-tabs { position: relative; }
.fls.is-loading .fls-tabs::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, var(--fls-accent), transparent);
	background-size: 40% 100%;
	background-repeat: no-repeat;
	animation: fls-bar 1s ease-in-out infinite;
}
@keyframes fls-spin { to { transform: rotate(360deg); } }
@keyframes fls-bar { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) {
	.fls.is-loading .fls-table-wrap::after,
	.fls-highlights.is-loading .fls-cards::after,
	.fls.is-loading .fls-tabs::after { animation-duration: 2.4s; }
}

.fls-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-variant-numeric: tabular-nums;
	font-size: 15px;
	border: 0;
}
.fls-table th,
.fls-table td {
	padding: 12px 10px;
	text-align: right;
	border: 0;
	border-bottom: 1px solid var(--fls-line);
	white-space: nowrap;
	vertical-align: middle;
	background: transparent;
}
.fls-table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: var(--fls-ink);
	color: #fff;
	padding: 0;
	font-family: var(--fls-head);
	font-weight: 500;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.fls-table thead th button {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	width: 100%;
	padding: 12px 10px;
	cursor: pointer;
	color: inherit;
}
.fls-table thead th button { transition: background-color .15s; }
.fls-table thead th button:hover,
.fls-table thead th button:focus-visible { color: #fff; background: rgba(255,255,255,.1); }
.fls-table thead th button:focus-visible { outline: 2px solid var(--fls-accent); outline-offset: -2px; }
.fls-table thead th.is-sorted { color: #fff; box-shadow: inset 0 -3px 0 var(--fls-accent); }
.fls-arrow { font-size: 9px; color: var(--fls-accent); }
.fls-table thead th.fls-lc { text-transform: none; }

.fls-table tbody tr:nth-child(even) td { background: #fafafa; }
.fls-table tbody tr:hover td { background: #fff6ec; }
.fls-table td.is-sorted { font-weight: 600; background: rgba(249,145,39,.06); }
.fls-table tbody tr:nth-child(even) td.is-sorted { background: rgba(249,145,39,.09); }

.fls-table .fls-col-rank { width: 56px; text-align: center; }
.fls-table thead .fls-col-rank button { justify-content: center; }
.fls-table .fls-col-player { text-align: left; white-space: normal; min-width: 180px; }
.fls-table thead .fls-col-player button { justify-content: flex-start; }
.fls-table td.fls-col-rating { font-weight: 700; color: var(--fls-ink); }
.fls-table thead th.fls-col-rating { background: var(--fls-accent); color: #fff; }
.fls-table thead th.fls-col-rating button:hover,
.fls-table thead th.fls-col-rating button:focus-visible { color: #fff; background: rgba(0,0,0,.14); }
.fls-table thead th.fls-col-rating.is-sorted { box-shadow: inset 0 -3px 0 #fff; }
.fls-table thead th.fls-col-rating .fls-arrow { color: #fff; }

.fls-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 6px;
	font-family: var(--fls-head);
	font-weight: 500;
	color: var(--fls-muted);
}
.fls-rank-top { color: #fff; background: var(--fls-accent); border-radius: 50px; }
.fls-rank-2 { background: var(--fls-charcoal-2); }
.fls-rank-3 { background: #8a8a8a; }

.fls-player {
	display: block;
	font-weight: 600;
	color: var(--fls-ink);
	text-decoration: none;
	line-height: 1.3;
}
a.fls-player:hover { color: var(--fls-accent); }
.fls-team { display: block; font-size: 13px; color: var(--fls-muted); line-height: 1.3; margin-top: 2px; }
.fls-no-results,
.fls-error { text-align: center !important; padding: 40px 16px !important; color: var(--fls-muted); white-space: normal !important; }

/* ---------- Pager ---------- */
.fls-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 0 0;
}
.fls-pager-info { font-size: 14px; color: var(--fls-muted); }
.fls-pages { display: flex; flex-wrap: wrap; gap: 4px; }
.fls .fls-page {
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	font: 500 14px/1 var(--fls-head);
	color: var(--fls-ink);
	background: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 0;
	cursor: pointer;
	transition: all .15s;
}
.fls .fls-page:hover:not(:disabled) { border-color: var(--fls-accent); color: var(--fls-accent); background: #fff; }
.fls .fls-page.is-active { background: var(--fls-accent); border-color: var(--fls-accent); color: #fff; }
.fls .fls-page:disabled { opacity: .35; cursor: default; }
.fls-gap { align-self: center; padding: 0 4px; color: var(--fls-muted); }

/* ---------- Legend & updated ---------- */
.fls-legend {
	margin-top: 20px;
	padding: 14px 16px;
	background: var(--fls-soft);
	font-size: 14px;
	color: #444;
}
.fls-legend summary {
	cursor: pointer;
	font-family: var(--fls-head);
	font-weight: 500;
	color: var(--fls-ink);
}
.fls-legend summary::marker { color: var(--fls-accent); }
.fls-legend p { margin: 10px 0 0; }
.fls-legend-keys { color: var(--fls-muted); font-size: 13px; }
.fls-updated { margin: 14px 0 0; font-size: 13px; color: var(--fls-muted); text-align: right; }

/* ---------- Highlights ---------- */
.fls-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
.fls .fls-pill {
	padding: 9px 22px;
	font: 500 15px/1 var(--fls-head);
	color: var(--fls-ink);
	background: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 50px;
	cursor: pointer;
	transition: all .15s;
}
.fls .fls-pill:hover { border-color: var(--fls-accent); color: var(--fls-accent); background: #fff; }
.fls .fls-pill.is-active { background: var(--fls-accent); border-color: var(--fls-accent); color: #fff; }

.fls-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	transition: opacity .15s;
}
.fls-cards { position: relative; }
.fls-card {
	display: flex;
	flex-direction: column;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--fls-line);
	border-top: 3px solid var(--fls-accent);
	box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.fls-card-label {
	font-family: var(--fls-head);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--fls-muted);
}
.fls-card-value {
	margin: 6px 0 10px;
	font-family: var(--fls-head);
	font-weight: 600;
	font-size: 34px;
	line-height: 1.1;
	color: var(--fls-accent);
}
.fls-card-value small { font-size: 14px; font-weight: 400; color: var(--fls-muted); }
.fls-card-player { font-weight: 600; font-size: 16px; line-height: 1.3; }
.fls-card-team { font-size: 13px; color: var(--fls-muted); margin-top: 2px; }

/* ---------- Champions ---------- */
.fls-champ-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.fls-champ {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 24px 16px;
	background: var(--fls-charcoal);
	color: #fff;
	margin: 0;
}
.fls-champ:first-child { background: var(--fls-ink); box-shadow: inset 0 -3px 0 var(--fls-accent); }
.fls-champ-icon { color: var(--fls-accent); line-height: 0; margin-bottom: 8px; }
.fls-champ-year { font-family: var(--fls-head); font-size: 28px; font-weight: 600; line-height: 1.1; }
.fls-champ-team { font-family: var(--fls-head); font-size: 17px; font-weight: 500; color: var(--fls-accent); margin-top: 4px; }
.fls-champ-meta { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.6); margin-top: 6px; }

/* Champion cards with a team photo */
.fls-champ.has-photo {
	position: relative;
	padding: 0;
	min-height: 260px;
	background-color: var(--fls-charcoal);
	background-size: cover;
	background-position: center;
	overflow: hidden;
}
.fls-champ.has-photo:first-child { box-shadow: none; }
.fls .fls-champ-btn {
	all: unset;
	box-sizing: border-box;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 260px;
	padding: 24px 16px 44px;
	text-align: center;
	color: #fff;
	cursor: zoom-in;
	background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.72) 100%);
	transition: background .25s;
}
.fls-champ.has-photo:first-child .fls-champ-btn { box-shadow: inset 0 -3px 0 var(--fls-accent); }
.fls .fls-champ-btn:hover,
.fls .fls-champ-btn:focus-visible { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.6) 100%); }
.fls .fls-champ-btn:focus-visible { outline: 3px solid var(--fls-accent); outline-offset: -3px; }
.fls-champ-btn .fls-champ-year,
.fls-champ-btn .fls-champ-team { text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.fls-champ-view {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	font: 500 12px/1 var(--fls-head);
	text-transform: uppercase;
	letter-spacing: .05em;
	white-space: nowrap;
	color: #fff;
	background: var(--fls-accent);
	border-radius: 50px;
	opacity: .9;
	transition: opacity .2s, transform .2s;
}
.fls-champ-btn:hover .fls-champ-view { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* Lightbox */
.fls-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0,0,0,.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s, visibility .2s;
}
.fls-lightbox.is-open { opacity: 1; visibility: visible; }
.fls-lightbox figure { margin: 0; max-width: 1200px; width: 100%; text-align: center; }
.fls-lightbox img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	margin: 0 auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.fls-lightbox figcaption {
	margin-top: 14px;
	font: 500 18px/1.3 var(--fls-head);
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #fff;
}
.fls .fls-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 28px;
	line-height: 44px;
	color: #fff;
	background: rgba(255,255,255,.12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}
.fls .fls-lightbox-close:hover,
.fls .fls-lightbox-close:focus-visible { background: var(--fls-accent); color: #fff; outline: none; }
body.fls-no-scroll { overflow: hidden; }

/* ---------- Overview CTA ---------- */
.fls-cta-wrap { text-align: center; margin: 32px 0 0; }
.fls .fls-btn {
	display: inline-block;
	padding: 14px 32px;
	font: 500 16px/1 var(--fls-head);
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #fff;
	background: var(--fls-accent);
	border-radius: 50px;
	text-decoration: none;
	transition: background-color .15s;
}
.fls .fls-btn:hover { background: var(--fls-ink); color: #fff; }

.fls-empty { padding: 32px; text-align: center; background: var(--fls-soft); color: var(--fls-muted); }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.fls { font-size: 14px; }
	.fls-tab { padding: 14px 14px; font-size: 14px; }
	.fls-controls { padding: 12px; }
	.fls-field { flex: 1 1 100%; max-width: none; }
	.fls .fls-select, .fls .fls-search { min-width: 0; }
	.fls-count { margin: 0; }
	.fls-hide-sm { display: none; }
	.fls-table { font-size: 14px; }
	.fls-table th, .fls-table td { padding: 10px 5px; }
	.fls-table thead th button { padding: 11px 5px; }
	.fls-table .fls-col-rank { width: 44px; }
	.fls-table .fls-col-player { min-width: 120px; }
	/* Keep rank + player visible while scrolling sideways. */
	.fls-table .fls-col-rank,
	.fls-table .fls-col-player { position: sticky; z-index: 1; background: #fff; }
	.fls-table .fls-col-rank { left: 0; }
	.fls-table .fls-col-player { left: 44px; box-shadow: 6px 0 6px -6px rgba(0,0,0,.18); }
	.fls-table tbody tr:nth-child(even) .fls-col-rank,
	.fls-table tbody tr:nth-child(even) .fls-col-player { background: #fafafa; }
	.fls-table thead .fls-col-rank,
	.fls-table thead .fls-col-player { z-index: 3; background: var(--fls-ink); }
	.fls-pager { justify-content: center; }
	.fls-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
	.fls-card { padding: 14px; }
	.fls-card-value { font-size: 26px; }
	.fls-card-player { font-size: 14px; }
	.fls-updated { text-align: center; }
	.fls-champ.has-photo, .fls .fls-champ-btn { min-height: 220px; }
	.fls-lightbox { padding: 12px; }
	.fls-lightbox figcaption { font-size: 15px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.fls-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
	.fls-cards { grid-template-columns: 1fr; }
}
