.h2h-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  width: 100%;
  flex-wrap: wrap;
  text-align: center;
  margin: 1rem 0;
}

.h2h-team {
  flex: 1 1 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.h2hCrest {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.h2h_title {
  font-size: 1.5rem;
  margin: 0;
}

/* Center the V absolutely between the two teams */
.h2h-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: bold;
}



.fixturedetails {
    background-color: #fff;
    padding: 0px;
    border-radius: 6px;
}

/* Team row */
.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* allows stacking on small screens */
    margin-bottom: 8px;
}

.team {
    display: flex;
    align-items: center;
    margin: 4px 0;
}

.team img {
    width: 28px;
    height: 28px;
    margin-right: 6px;
}

.vs {
    flex: 0 0 100%;
    text-align: center;
    font-weight: bold;
    margin: 4px 0;
}

/* Last 5 meetings row */
.last-five-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.home-icons, .away-icons {
    display: flex;
    gap: 2px; /* spacing between icons */
    margin: 4px 0;
}

.label {
    flex: 1 1 100%;
    text-align: center;
    margin: 4px 0;
}


.fixturedetails-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.highlight-box {
    flex: 0 0 400px;
    max-width: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    text-align: center;
    border: 1px solid #d3d3d3;
}

.highlight-header {
    font-weight: normal;
    margin-bottom: 4px;
    line-height: 2;
    text-align: center;
    border-radius: 10px 10px 0px 0px
}

.highlight-circle {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    line-height: 40px;
    color: #fff;
    font-weight: bold;
    margin: 4px 0;
}

.highlight-crest img {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin: 2px;
}

.highlight-team {
    margin: 2px 0;
}

.highlight-line {
    display: flex;
    align-items: center;
    justify-content: center; /* or space-between if you want edges */
    gap: 8px; /* space between items */
    margin-bottom: 8px;
    margin-top: 8px;
}

.highlight-content {
    margin: 10px 0;
    font-size: 1em;
}

.team-'.$home_team_slug.' {
     background-color: ' . htmlspecialchars($home_color) . ';
     color: ' . htmlspecialchars($home_font_color) . ';
}

.team-'.$away_team_slug.' {
     background-color: ' . htmlspecialchars($away_color) . ';
     color: ' . htmlspecialchars($away_font_color) . ';
}

.left {
	text-align: left;
}

.right {
	text-align: right;
}


.fixturedetails-charts {
    display: flex;
    flex-wrap: wrap; /* allows wrapping on smaller screens */
    gap: 10px;       /* spacing between boxes */
    justify-content: center; /* center the row */
}

.card-split {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 10px 15px;
    gap: 10px;
}

.card-left {
    text-align: left;
}

.card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    min-height: 24px;
}

.mini-card {
    width: 18px;
    height: auto;
    margin-right: 1px;
    display: inline-block;
    vertical-align: top;
}

.no-cards {
    color: #888;
    font-size: 14px;
    font-style: italic;
}

.card-right {
    width: 60px; /* fixed narrow width */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 6px;
    flex-shrink: 0;
}

.card-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-circle.yellow {
    background: #ffcc00;
    color: #333;
}

.card-circle.orange {
    background: #ffa500;
    color: #fff;
}

.card-circle.red {
    background: #e00000;
    color: #fff;
}


.analTable {
	width: fit-content;
}

.analMatch {
	display: grid;
	grid-template-columns: 35px 50px minmax(420px, 1fr) 50px minmax(150px, 1fr) minmax(60px, 1fr) minmax(60px, auto);
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid #ddd;
}

.analReport {
	text-align: center;
}

.analReport img {
	width: 30px;
	height: 30px;
}

.analDate {
	text-align: center;
}

.analTeams {
	min-width: 0;
}

.analStatsHead,
.analTeamRow {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 50px 70px 55px 55px;
	align-items: center;
	column-gap: 8px;
}

.analStatsHead {
	margin-bottom: 3px;
	font-size: 9px;
	font-weight: bold;
	text-align: center;
}

.analStatsHead div:first-child {
	text-align: left;
}

.analTeamRow {
	min-height: 28px;
}

.analTeamName {
	min-width: 0;
}

.analTeamScore {
	font-size: 20px;
	font-weight: bold;
	text-align: center;
}

.analTries,
.analCards,
.analPenalties {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	align-content: center;
	gap: 2px;
	min-width: 0;
}

.analPenalties .circle3 {
	width: 28px;
	height: 28px;
}

.analTries .balls {
	width: 14px;
	height: 14px;
}

.analCards .yellow_card,
.analCards .red_card {
	width: 10px;
	height: 16px;
}

.analPenalties {
	justify-content: center;
}

.analCompetition,
.analReferee,
.analVenue,
.analAttendance {
	min-width: 0;
}


.analAttendance {
	text-align: right;
	padding-right: 5px;
	border-left: 1px solid #d3d3d3;
}

.charts-wrapper {
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
}


.fixturedetails-charts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	width: 100%;
}

.fixture-chart-box {
	flex: 1 1 380px;
	max-width: 400px;
	text-align: center;
	min-width: 0;
}

.fixture-chart-svg {
	width: 100%;
	display: flex;
	justify-content: center;
}

.fixture-chart-svg svg {
	display: block;
	max-width: 100%;
	height: auto;
}

#d3Chart7Wrap {
	width: 100%;
	overflow-x: auto;
}

#d3Container7 {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
}





/* Mobile adjustments */

@media (max-width: 700px) {
	  .h2h-container {
	    flex-direction: column;
	  }
	
	  .h2h-team {
	    flex: 1 1 100%;
	    margin-bottom: 0.5rem;
	  }
	
	  .h2h-vs {
	    position: static; /* stack normally in mobile */
	    transform: none;
	    font-size: 1.5rem;
	    margin: 0.5rem 0;
	  }
	
	  .h2hCrest {
	    width: 60px;
	    height: 60px;
	  }
	
	  .h2h_title {
	    font-size: 1.2rem;
	  }
  
  	.highlight-box {
    	flex: 0 0 95vw;
  	}

	.analMatch {
		grid-template-columns:
			30px
			35px
			minmax(280px, 1fr)
			35px;
		gap: 2px;
	}
	
	.analStatsHead,
	.analTeamRow {
		grid-template-columns: minmax(0, 1fr) 30px 50px 40px 40px;
		column-gap: 2px;
	}

	.analReferee,
	.analVenue,
	.analAttendance {
		display: none;
	}

	.analReport img {
		width: 25px;
		height: 25px;
	}

	.analDate {
		font-size: 11px;
	}

	.analTries {
		margin-top: 0px;
		gap: 1px;
	}

	.analTries .balls {
		width: 12px;
		height: 12px;
		margin-bottom: 0px;
	}

	.analCards .yellow_card,
	.analCards .red_card {
		width: 10px;
		height: 15px;
	}

	.dateHold {
		padding: 0px;
	}
	
	.fixturedetails {
		width: 100vw;
	}

	.fixturedetails-charts {
		gap: 10px;
	}

	.fixture-chart-box {
		flex: 1 1 100%;
		max-width: 100%;
	}

	.fixture-chart-svg svg {
		width: 170px;
		height: 170px;
	}

	#d3Chart7Wrap {
		overflow-x: hidden;
	}
	
	.card-split {
		flex-direction: column;
	}

	.card-right {
		width: 100%;
		flex-direction: row;
		justify-content: center;
		gap: 10px;
	}
}


