/* ========================================================================
   AFW LEAGUE PAGE
   templates:
   - league.php
   ======================================================================== */

.afw-matches-grid{
  display:grid;
  gap:18px;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  margin-top:14px;
  width:100%;
  max-width:100%;
}

.afw-match{
  display:block;
  text-decoration:none;
  color:inherit;
  background:rgba(255,255,255,.08);
  overflow:hidden;
  padding:10px 10px;
  max-width:100%;
}

.no-touch .afw-match:hover{ background:rgba(255,255,255,.10); }

.afw-match__row{
  display:flex;
  align-items:stretch;
  gap:16px;
  width:100%;
  max-width:100%;
  min-width:0;
}

.afw-teams{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.afw-team{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  max-width:100%;
}

.afw-team__logo{
  width:44px;
  height:44px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.afw-team__logo img{
  width:44px;
  height:44px;
  object-fit:contain;
  display:block;
}

.afw-team__text{
  min-width:0;
  display:flex;
  flex-direction:column;
  max-width:100%;
}

.afw-team__label{
  font-size:12px;
  line-height:1;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:rgba(255,255,255,.45);
}

.afw-team__label--top{ margin-bottom:6px; }
.afw-team__label--bottom{ margin-top:6px; }

.afw-team__name{
  font-family:var(--h1-font-family);
  font-size:16px;
  line-height:1.15;
  font-weight:600;
  color:var(--color-content-heading);
  min-width:0;
  white-space:normal;
  overflow:visible;
  text-overflow:unset;
  overflow-wrap:anywhere;
  word-break:normal;
}

.afw-between{
  display:flex;
  gap:14px;
  align-items:center;
  margin:10px 0;
  min-width:0;
}

.afw-badge-live,
.afw-badge-minute{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:38px;
  padding:0 18px;
  border-radius:12px;
  font-family:var(--h1-font-family);
  font-size:14px;
  line-height:1;
  font-weight:700;
  color:#ff2b2b;
  background:transparent;
  max-width:100%;
}

.afw-match__right{
  flex:0 0 auto;
  width:100px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-end;
  text-align:right;
  padding-left:16px;
  position:relative;
}

.afw-match__right:before{
  content:"";
  position:absolute;
  left:0;
  top:6px;
  bottom:6px;
  width:1px;
  background:rgba(255,255,255,.14);
}

.afw-score,
.afw-time{
  font-family:var(--h1-font-family);
  font-size:26px;
  line-height:1;
  font-weight:700;
  color:var(--color-content-heading);
}

.afw-match .afw-status{
  margin-top:10px;
  font-family:var(--h5-font-family);
  font-size:12px;
  line-height:var(--h5-line-height);
  font-weight:600;
  color:rgba(255,255,255,.70);
}

.afw-match .afw-status.is-live{ color:#ff4fa3; }
.afw-match .afw-status.is-ft{ color:rgba(255,255,255,.70); }
.afw-match .afw-status.is-cancelled{ color:rgba(255,255,255,.55); }

/* standings */
.afw-standings{
  display:grid;
  gap:6px;
  max-width:600px;
  margin:0 auto;
}

.afw-standings__row{
  display:grid;
  grid-template-columns:40px 1fr 40px 40px 40px 40px 50px 50px;
  align-items:center;
  padding:8px 12px;
  background:rgba(255,255,255,.02);
  font-size:14px;
}

.afw-standings__row--head{
  font-weight:700;
  opacity:.7;
  background:transparent;
  font-size:12px;
  text-transform:uppercase;
}

.afw-standings__col{
  text-align:center;
  font-size:14px;
  font-weight:600;
  color:#fff;
}

.afw-standings__col--rank,
.afw-standings__col--team{ text-align:left; }

.afw-standings__col--pts{ font-weight:700; }

.afw-standings__team{
  display:flex;
  align-items:center;
  font-size:14px;
  color:#fff;
  font-weight:600;
  gap:8px;
  min-width:0;
}

.afw-standings__team img{
  width:20px;
  height:20px;
  object-fit:contain;
}

/* team stats block */
.afw-ts{
  width:100%;
  --ts-bg:#111111;
  --ts-card-bg:#1a1a1a;
  --ts-border:rgba(255,255,255,0.15);
  --ts-border-light:rgba(255,255,255,0.08);
  --ts-text-main:#ffffff;
  --ts-text-muted:#9aa0a6;
  --ts-text-dim:#606060;
  --ts-accent-red:#e31b23;
  --ts-accent-white:#e0e0e0;
  --ts-accent-gold:#ffc107;
  --ts-radius:8px;
}

.afw-ts *{
  box-sizing:border-box;
  text-align:center;
  font-family:var(--ts-font-family);
}

.afw-ts__kpis{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
  margin:0 0 24px 0;
}

.afw-ts__kpi{
  display:flex;
  align-items:center;
  gap:16px;
  padding:16px;
  background:var(--ts-card-bg);
  min-width:0;
  transition:border-color .2s;
  position:relative;
  padding-top:44px;
}

.afw-ts__kpiTitle{
  font-size:12px;
  letter-spacing:.5px;
  color:var(--ts-text-muted);
  font-weight:600;
  position:absolute;
  top:16px;
  left:16px;
  right:16px;
  text-align:center;
  margin:0;
}

.afw-ring{
  --size:80px;
  --thick:5px;
  width:var(--size);
  height:var(--size);
  border-radius:50%;
  display:grid;
  place-items:center;
  background:conic-gradient(
    var(--ts-accent-red) calc(var(--p) * 1%),
    rgba(255,255,255,0.1) 0
  );
  position:relative;
  flex:0 0 auto;
}

.afw-ring::before{
  content:"";
  position:absolute;
  inset:var(--thick);
  border-radius:50%;
  background:var(--ts-card-bg);
}

.afw-ring__in{ position:relative; z-index:1; text-align:center; line-height:1.1; }
.afw-ring__val{ font-weight:700; font-size:14px; color:var(--ts-text-main); }
.afw-ring__lbl{ font-size:9px; font-weight:600; letter-spacing:.5px; color:var(--ts-text-muted); margin-top:2px; }

.afw-league-seasons-line {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
	margin: 8px 0 18px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.afw-league-seasons-line__item {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 4px 4px;
	font-weight:500;
	background: rgba(255,255,255,.03);
	color: inherit;
	text-decoration: none;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	transition: .2s ease;
}

.afw-league-seasons-line__item:hover {
	border-color: rgba(255,255,255,.28);
	background: rgba(255,255,255,.07);
	font-weight:600;
}

.afw-league-seasons-line__item.is-active {
	border-color: #ff3b30;
	font-weight:600;
	background: rgba(255,59,48,.12);
	color: #fff;
}

@media (max-width: 767px) {
	.afw-league-seasons-line {
		gap: 6px;
		margin: 8px 0 16px;
	}

	.afw-league-seasons-line__item {
		min-height: 26px;
		padding: 4px 9px;
		font-size: 11px;
	}
}

/* League player statistics */
.afw-league-player-stats {
	display: grid;
	gap: 16px;
}

.afw-league-player-stats__head {
	display: grid;
	gap: 5px;
	margin-bottom: 4px;
	text-align: center;
}

.afw-league-player-stats__title {
	margin: 0;
	color: #fff;
	font-family: var(--h1-font-family);
	font-size: 24px;
	line-height: 1.15;
	font-weight: 800;
}

.afw-league-player-stats__note {
	margin: 0;
	color: rgba(255, 255, 255, .58);
	font-size: 13px;
	line-height: 1.35;
	font-weight: 600;
}

.afw-league-player-stats__filters {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 4px;
	-webkit-overflow-scrolling: touch;
}

.afw-league-player-stats__filter {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0 12px;
	background: #050707;
	color: #fff;
	text-decoration: none;
	font-family: var(--h5-font-family);
	font-size: 13px;
	line-height: 1;
	font-weight: 600;
}

.afw-league-player-stats__filter.is-active {
	background: #fff;
	color: #111;
}

.afw-league-player-stats__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 7px 12px;
	align-items: center;
	padding: 10px 12px;
	background: rgba(255, 255, 255, .04);
	border: 1px solid rgba(255, 255, 255, .08);
	color: rgba(255, 255, 255, .66);
	font-family: var(--h5-font-family);
	font-size: 11px;
	line-height: 1.25;
	font-weight: 600;
}

.afw-league-player-stats__legend-title {
	color: #fff;
	font-weight: 800;
	text-transform: uppercase;
}

.afw-league-player-stats__legend-item {
	display: inline-flex;
	gap: 4px;
	align-items: baseline;
	white-space: nowrap;
}

.afw-league-player-stats__legend-item strong {
	color: #fff;
	font-weight: 900;
}

.afw-league-player-stats__table-wrap {
	overflow-x: auto;
	background: rgba(255, 255, 255, .04);
	border: 1px solid rgba(255, 255, 255, .08);
	-webkit-overflow-scrolling: touch;
}

.afw-league-player-stats__table {
	width: 100%;
	min-width: 920px;
	border-collapse: collapse;
}

.afw-league-player-stats__table th {
	padding: 10px 8px;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
	color: rgba(255, 255, 255, .62);
	font-family: var(--h5-font-family);
	font-size: 11px;
	line-height: 1.15;
	font-weight: 800;
	text-align: center;
	text-transform: uppercase;
	white-space: nowrap;
}

.afw-league-player-stats__table td {
	padding: 10px 8px;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
	color: #fff;
	font-family: var(--h5-font-family);
	font-size: 13px;
	line-height: 1.2;
	font-weight: 700;
	text-align: center;
	white-space: nowrap;
}

.afw-league-player-stats__table tbody tr:last-child td {
	border-bottom: 0;
}

.no-touch .afw-league-player-stats__table tbody tr:hover {
	background: rgba(255, 255, 255, .04);
}

.afw-league-player-stats__td--player,
.afw-league-player-stats__th--player {
	position: sticky;
	left: 0;
	z-index: 2;
	min-width: 190px;
	background: #151a19;
	text-align: center !important;
}

.afw-league-player-stats__th--player {
	z-index: 3;
}

.afw-league-player-stats__td--rank,
.afw-league-player-stats__th--rank {
	width: 36px;
	color: rgba(255, 255, 255, .72);
}

.afw-league-player-stats__td--team,
.afw-league-player-stats__th--team {
	width: 64px;
	min-width: 64px;
}

.afw-league-player-stats__td--position,
.afw-league-player-stats__td--appearances,
.afw-league-player-stats__td--lineups,
.afw-league-player-stats__td--minutes,
.afw-league-player-stats__td--goals,
.afw-league-player-stats__td--assists,
.afw-league-player-stats__td--rating,
.afw-league-player-stats__th--position,
.afw-league-player-stats__th--appearances,
.afw-league-player-stats__th--lineups,
.afw-league-player-stats__th--minutes,
.afw-league-player-stats__th--goals,
.afw-league-player-stats__th--assists,
.afw-league-player-stats__th--rating {
	width: 58px;
}

.afw-league-player-stats__team-cell,
.afw-league-player-stats__player-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
}

.afw-league-player-stats__player-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afw-league-player-stats__avatar-img,
.afw-league-player-stats__avatar-fallback {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	flex: 0 0 44px;
	background: #fff;
	object-fit: cover;
}

.afw-league-player-stats__avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #111;
	font-size: 16px;
	font-weight: 900;
}

.afw-league-player-stats__team-logo {
	display: block;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	object-fit: contain;
}

.afw-league-player-stats__rating {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	min-height: 28px;
	padding: 0 8px;
	background: #050707;
	color: #a7e84b;
	font-size: 14px;
	line-height: 1;
	font-weight: 900;
}

.afw-league-player-stats__empty {
	color: rgba(255, 255, 255, .35);
}

.afw-leagueIndexGrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}

.afw-leagueIndexItem {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 62px;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, .10);
	border-radius: 6px;
	background: rgba(255, 255, 255, .04);
	color: inherit;
	text-decoration: none;
}

.afw-leagueIndexItem:hover {
	border-color: rgba(167, 232, 75, .35);
	background: rgba(167, 232, 75, .08);
}

.afw-leagueIndexItem img {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	object-fit: contain;
}

.afw-leagueIndexItem span {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.afw-leagueIndexItem strong,
.afw-leagueIndexItem small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afw-leagueIndexItem strong {
	font-size: 14px;
	line-height: 1.2;
}

.afw-leagueIndexItem small {
	color: rgba(255, 255, 255, .55);
	font-size: 12px;
}

.afw-league-rounds__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.afw-league-rounds__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 54px;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 8px;
	background: rgba(255, 255, 255, .04);
	color: inherit;
	text-decoration: none;
}

.afw-league-rounds__item:hover {
	border-color: rgba(167, 232, 75, .35);
	background: rgba(167, 232, 75, .08);
}

.afw-league-rounds__name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 700;
}

.afw-league-rounds__meta {
	flex: 0 0 auto;
	color: rgba(255, 255, 255, .58);
	font-size: 12px;
}

@media (max-width: 767px) {
	.afw-league-player-stats__title {
		font-size: 20px;
	}

	.afw-league-player-stats__filter {
		min-height: 28px;
		padding: 0 12px;
		font-size: 12px;
	}

	.afw-league-player-stats__legend {
		gap: 6px 10px;
		padding: 9px 10px;
		font-size: 10px;
	}

	.afw-league-player-stats__table {
		min-width: 900px;
	}

	.afw-league-player-stats__table th,
	.afw-league-player-stats__table td {
		padding: 10px;
		font-size: 12px;
	}

	.afw-league-player-stats__td--player,
	.afw-league-player-stats__th--player {
		min-width: 180px;
	}

	.afw-league-player-stats__avatar-img,
	.afw-league-player-stats__avatar-fallback,
	.afw-league-player-stats__team-logo {
		width: 38px;
		height: 38px;
		flex-basis: 38px;
	}

	.afw-league-rounds__grid {
		grid-template-columns: 1fr;
	}
}
