/*
 * Home: NPL quick live score card — home-sections/npl-live-score.php
 * Source: Figma kPm72yTtU6jjIKiioCKkwx › Score Card (6177:14715), 1133 × 194.
 * Ball event animation: npl-ballfx.css (shared with the NPL match score card).
 */

.nhs {
	/* Figma variables used by the card */
	--nhs-bg: #0e0e18;
	--nhs-sponsor-bg: #0e0e18; /* fallback; real colour set inline per season */
	--nhs-text: #ededed;
	--nhs-muted: #c5c6c8; /* Color/Grey/400 */
	--nhs-line: rgba(229, 229, 229, 0.2);
	--nhs-pill-line: #e7e7e9; /* Color/Grey/200 */
	--nhs-pill-bg: #efefef;
	--nhs-pill-ink: #1c2346; /* Color/Dark/600 */
	--nhs-brand: #1685f8; /* Color/Primary/500 */
	--nhs-live: #ff6b6b;
	--nhs-four: #6b00c9;
	--nhs-six: #107ced;
	--nhs-wicket: #ff0201;
	--nhs-chip-line: rgba(255, 255, 255, 0.68);
	--nhs-font-en: 'Inter', sans-serif;
	--nhs-font-np: 'Anek Devanagari', 'Mukta', sans-serif;

	position: relative;
	display: grid;
	grid-template-columns: 182px minmax(0, 1fr);
	grid-template-rows: 153px auto;
	border-radius: 6px;
	background: var(--nhs-bg);
	font-family: var(--nhs-font-en);
	color: #fff;
	overflow: hidden;
	isolation: isolate;
}

.nhs-section {
	margin-bottom: 20px;
}

.nhs p,
.nhs ul {
	margin: 0;
	padding: 0;
}

.nhs a {
	text-decoration: none;
}

/* ---------- Background decoration ---------- */

.nhs__fx {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

.nhs__fx > * {
	position: absolute;
	display: block;
	max-width: none;
}

.nhs__fx-stadium {
	top: -444px;
	left: 0;
	width: 100%;
	min-width: 1133px;
	height: 638px;
	background: url('../../img/npl-home/stadium-bg.jpg') center / cover no-repeat;
	opacity: 0.1;
	mix-blend-mode: plus-lighter;
}

.nhs__fx-fade {
	top: -5px;
	left: 0;
	width: 100%;
	height: 158px;
	background: linear-gradient(to top, rgba(9, 9, 16, 0) 0%, rgba(9, 9, 16, 0.99) 45.96%);
}

.nhs__fx-glow {
	top: -223px;
	left: 115px;
}

.nhs__fx-beam {
	transform: rotate(-90deg);
}

.nhs__fx-beam--a {
	top: -125px;
	left: 583px;
}

.nhs__fx-beam--b {
	top: -157.5px;
	left: 579.5px;
}

/* ---------- Sponsor panel ---------- */

.nhs__sponsor {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--nhs-sponsor-bg);
}

.nhs__sponsor img {
	display: block;
	width: 118px;
	height: 77px;
}

/* ---------- Head ---------- */

.nhs__main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.nhs__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 71px;
	padding: 0 20px 0 36px;
	border-bottom: 1px solid var(--nhs-line);
}

.nhs__title {
	display: flex;
	align-items: center;
	gap: 7px;
	font-weight: 800;
	font-size: 16px;
	line-height: 12px;
	color: var(--nhs-text);
}

.nhs__live {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 15px;
	border-radius: 2px;
	background: var(--nhs-live);
	font-family: 'Mukta', sans-serif;
	font-weight: 600;
	font-size: 11px;
	line-height: 1;
	color: #fff;
	animation: nhs-live 1.6s ease-in-out infinite;
}

@keyframes nhs-live {
	50% {
		opacity: 0.6;
	}
}

.nhs__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin-top: 10px !important;
	font-weight: 400;
	font-size: 12px;
	line-height: 12px;
	color: var(--nhs-muted);
}

.nhs__dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #d9d9d9;
}

.nhs__links {
	display: flex;
	flex: none;
	gap: 7px;
}

.nhs__pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 32px;
	padding: 8px 20px;
	border-radius: 85px;
	font-weight: 600;
	font-size: 12px;
	line-height: 12px;
	white-space: nowrap;
	transition: all 0.3s ease;
}

.nhs__pill--outline {
	border: 1px solid var(--nhs-pill-line);
	color: var(--nhs-pill-line);
}

.nhs__pill--outline:hover {
	background: var(--nhs-pill-line);
	color: var(--nhs-pill-ink);
}

.nhs__pill--solid {
	background: var(--nhs-pill-bg);
	color: var(--nhs-pill-ink);
}

.nhs__pill--solid:hover {
	background: var(--nhs-brand);
	color: #fff;
}

/* ---------- Teams ---------- */

.nhs__body {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 0 14px 0 26px;
}

.nhs__teams {
	display: flex;
	flex: 0 1 542px;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-width: 0;
}

.nhs-team {
	display: flex;
	align-items: center;
	gap: 18px;
	min-width: 0;
}

.nhs-team--away {
	gap: 12px;
}

.nhs-team__logo {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 52.636px;
	height: 52.636px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
}

.nhs-team__logo img {
	display: block;
	width: 31.297px;
	height: 31.297px;
}

.nhs-team__info {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 0;
}

.nhs-team--away .nhs-team__info {
	align-items: flex-end;
	gap: 5px;
	text-align: right;
}

.nhs-team__name {
	font-family: var(--nhs-font-np);
	font-weight: 700;
	font-size: 16px;
	line-height: normal;
	color: #fff;
	white-space: nowrap;
}

.nhs-team__score {
	display: flex;
	align-items: baseline;
	gap: 7px;
	white-space: nowrap;
}

.nhs-team__score strong,
.nhs-team__status {
	font-weight: 400;
	font-size: 19.199px;
	line-height: 14.226px;
	color: #fff;
}

.nhs-team__score span {
	font-size: 12px;
	line-height: 14.226px;
	color: rgba(255, 255, 255, 0.78);
}

.nhs-team__status {
	color: rgba(255, 255, 255, 0.6);
	white-space: nowrap;
}

/* ---------- Innings + ball event ---------- */

.nhs__innings {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6.5px;
	flex: none;
}

.nhs__innings-link {
	font-weight: 600;
	font-size: 14px;
	line-height: 17.518px;
	color: var(--nhs-brand);
	white-space: nowrap;
	transition: all 0.3s ease;
}

.nhs__innings-link:hover {
	color: #6bb1fa;
}

/* Live indicator: a short segment sweeps across a 45px track (same as the NPL score card) */
.nhs__live-bar {
	position: relative;
	display: block;
	width: 45px;
	height: 3px;
	border-radius: 3.412px;
	background: rgba(22, 133, 248, 0.18);
	overflow: hidden;
}

.nhs__live-bar::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 45%;
	height: 100%;
	border-radius: inherit;
	background: var(--nhs-brand);
	animation: nhs-live-sweep 1.4s ease-in-out infinite;
}

@keyframes nhs-live-sweep {
	0% {
		transform: translateX(-100%);
	}

	100% {
		transform: translateX(230%);
	}
}

/* Ball event sits right above the innings label; light ink for the dark card */
.nhs .npl-ballfx {
	--npl-ballfx-ink: #fff;
	--npl-ballfx-run-bg: rgba(22, 133, 248, 0.2);
	--npl-ballfx-run-ink: #6bb1fa;
	bottom: calc(100% + 2px);
	left: calc(50% - 60px);
}

/* ---------- This over ---------- */

.nhs__over {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 8px;
	width: 240px;
}

.nhs__over-stats {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-weight: 500;
	font-size: 12px;
	line-height: 17px;
	color: var(--nhs-muted);
	white-space: nowrap;
}

.nhs__chips {
	display: flex;
	align-items: center;
	gap: 5.882px;
	margin-left: 2px !important;
	list-style: none;
}

.nhs-chip {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	border: 0.588px solid var(--nhs-chip-line);
	border-radius: 2.353px;
	font-weight: 700;
	font-size: 10.588px;
	line-height: 20px;
	color: #fff;
}

.nhs-chip--wide {
	width: 25.882px;
}

.nhs-chip--dot {
	border: 0;
}

.nhs-chip--dot img {
	display: block;
	width: 20px;
	height: 20px;
}

.nhs-chip--four {
	border-color: var(--nhs-four);
	background: var(--nhs-four);
}

.nhs-chip--six {
	border-color: var(--nhs-six);
	background: var(--nhs-six);
	color: rgba(255, 255, 255, 0.8);
}

.nhs-chip--wicket {
	border: 1.176px solid var(--nhs-wicket);
	background: var(--nhs-wicket);
}

/* ---------- Footer ---------- */

.nhs__foot {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 41px;
	padding: 8px 20px 8px 13px;
	border-top: 1px solid var(--nhs-line);
}

.nhs__powered {
	display: flex;
	align-items: center;
	gap: 14.48px;
}

.nhs__powered img {
	display: block;
	flex: none;
}

.nhs__powered-label {
	font-family: 'Mukta', sans-serif;
	font-weight: 800;
	font-size: 13.575px;
	line-height: 16.29px;
	color: #fff;
	text-transform: uppercase;
	white-space: nowrap;
}

.nhs__logo-omoda {
	width: 112.308px;
	height: 15.385px;
}

.nhs__logo-siddhartha {
	width: 128.265px;
	height: 24.481px;
}

.nhs__logo-himalaya {
	width: 84.41px;
	height: 24.203px;
}

.nhs__toss {
	font-weight: 400;
	font-size: 14px;
	line-height: 16px;
	color: var(--nhs-muted);
	text-align: right;
}

/* ---------- Responsive ---------- */

/* Narrower desktop: tighten the gap between teams and the over panel */
@media (max-width: 1180px) {
	.nhs__body {
		gap: 20px;
	}

	.nhs__teams {
		flex: 1 1 auto;
	}

	.nhs__over {
		width: 220px;
	}

	.nhs__over-stats {
		gap: 8px;
	}
}

/* Tablet: sponsor stays left, the over panel drops under the teams */
@media (max-width: 1023px) {
	.nhs {
		grid-template-columns: 140px minmax(0, 1fr);
		grid-template-rows: auto auto;
	}

	.nhs__sponsor img {
		width: 96px;
		height: auto;
	}

	.nhs__head {
		height: auto;
		padding: 16px 20px 14px 24px;
	}

	.nhs__body {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 28px 20px 16px 24px;
	}

	.nhs__teams {
		flex: none;
	}

	.nhs__over {
		width: auto;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding-top: 12px;
		border-top: 1px solid var(--nhs-line);
	}

	.nhs__over-stats {
		gap: 16px;
	}

	.nhs__foot {
		flex-wrap: wrap;
	}
}

/* Mobile: sponsor becomes a strip on top, teams stack as rows (logo · name · score) */
@media (max-width: 767px) {
	.nhs {
		grid-template-columns: minmax(0, 1fr);
	}

	.nhs__sponsor {
		height: 56px;
	}

	.nhs__sponsor img {
		width: auto;
		height: 42px;
	}

	.nhs__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 14px 16px;
	}

	.nhs__meta {
		row-gap: 4px;
	}

	.nhs__pill {
		height: 30px;
		padding: 6px 16px;
	}

	/*
	 * Teams stack as rows; the over row carries "This Over · CRR · RRR" on the left
	 * and the innings label on the right, chips below. Wrappers flatten into one grid.
	 */
	.nhs__body {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			'home home'
			'away away'
			'stats innings'
			'chips chips';
		gap: 10px 0; /* no column gap so the over-row divider runs unbroken */
		padding: 12px 16px 14px;
	}

	.nhs__teams,
	.nhs__over {
		display: contents;
	}

	.nhs-team {
		grid-area: home;
	}

	.nhs-team--away {
		grid-area: away;
	}

	.nhs__over-stats,
	.nhs__innings {
		align-self: stretch;
		margin-top: 2px;
		padding-top: 12px;
		border-top: 1px solid var(--nhs-line);
	}

	.nhs__innings {
		grid-area: innings;
		align-items: flex-end;
		gap: 5px;
	}

	/* Ball event plays to the right of the chips row, under the innings label */
	.nhs .npl-ballfx {
		top: auto;
		bottom: -32px;
		left: auto;
		right: -6px;
	}

	.nhs-team,
	.nhs-team--away {
		gap: 10px;
	}

	.nhs-team--away {
		flex-direction: row-reverse;
	}

	.nhs-team__logo {
		width: 40px;
		height: 40px;
	}

	.nhs-team__logo img {
		width: 24px;
		height: 24px;
	}

	.nhs-team__info,
	.nhs-team--away .nhs-team__info {
		flex: 1;
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
		gap: 8px;
		text-align: left;
	}

	.nhs-team__name {
		font-size: 15px;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.nhs-team__score strong,
	.nhs-team__status {
		font-size: 17px;
	}

	.nhs__over-stats {
		grid-area: stats;
		justify-content: flex-start;
		align-items: flex-start;
		flex-wrap: wrap;
		gap: 4px 14px;
		padding-right: 12px;
	}

	.nhs__chips {
		grid-area: chips;
		flex-wrap: wrap;
		margin: -2px 0 0 !important;
	}

	.nhs__foot {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		padding: 10px 16px 12px;
	}

	.nhs__powered {
		flex-wrap: wrap;
		gap: 10px 12px;
	}

	.nhs__powered-label {
		font-size: 12px;
		flex-basis: 100%;
	}

	.nhs__logo-omoda {
		width: 90px;
		height: auto;
	}

	.nhs__logo-siddhartha {
		width: 102px;
		height: auto;
	}

	.nhs__logo-himalaya {
		width: 68px;
		height: auto;
	}

	.nhs__toss {
		font-size: 12px;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nhs__live {
		animation: none;
	}

	.nhs__live-bar::before {
		width: 100%;
		animation: none;
	}
}
