/* ==========================================================================
   Al-Hadaf — Match stream player (pro design, servers on top, ad shield)
   ========================================================================== */

.alh-stream {
	--st-ink: var(--alhadaf-header-bg, #0b132b);
	--st-ink-2: #162345;
	--st-accent: var(--alhadaf-accent, #e63946);
	--st-live: var(--alhadaf-live, #ef4444);
	--st-line: rgba(255, 255, 255, 0.12);
	--st-text: #fff;
	--st-muted: rgba(255, 255, 255, 0.58);

	position: relative;
	margin-top: 26px;
	padding: 16px;
	border-radius: 22px;
	background:
		radial-gradient(700px 260px at 92% -30%, rgba(230, 57, 70, 0.22), transparent 60%),
		linear-gradient(150deg, var(--st-ink) 0%, var(--st-ink-2) 100%);
	color: var(--st-text);
	box-shadow: 0 22px 48px rgba(11, 19, 43, 0.26);
	overflow: hidden;
}

.alh-stream *,
.alh-stream *::before,
.alh-stream *::after {
	box-sizing: border-box;
}

/* Header ----------------------------------------------------------------- */

.alh-stream-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.alh-stream-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	color: #fff;
}

.alh-stream-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: rgba(230, 57, 70, 0.16);
	border: 1px solid rgba(230, 57, 70, 0.3);
	color: var(--st-accent);
}

.alh-stream-live {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(239, 68, 68, 0.16);
	border: 1px solid rgba(239, 68, 68, 0.4);
	font-size: 10.5px;
	font-weight: 800;
	color: #fecaca;
}

.alh-stream-live i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--st-live);
	animation: alh-stream-pulse 1.6s ease-out infinite;
}

@keyframes alh-stream-pulse {
	0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
	70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
	100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.alh-stream-match {
	font-size: 12px;
	font-weight: 600;
	color: var(--st-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Servers bar (top) ------------------------------------------------------ */

.alh-stream-serversbar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px;
	padding: 8px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid var(--st-line);
	min-width: 0;
}

.alh-stream-servers-label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	flex: 0 0 auto;
	padding-inline-start: 4px;
	font-size: 11px;
	font-weight: 700;
	color: var(--st-muted);
	white-space: nowrap;
}

.alh-stream-servers {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	flex: 1 1 auto;
	overflow-x: auto;
	scrollbar-width: none;
	padding-bottom: 2px;
	scroll-behavior: smooth;
}

.alh-stream-servers::-webkit-scrollbar {
	display: none;
}

.alh-stream-server {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	padding: 8px 13px;
	border-radius: 999px;
	border: 1px solid var(--st-line);
	background: rgba(255, 255, 255, 0.055);
	color: rgba(255, 255, 255, 0.82);
	font-family: inherit;
	font-size: 11.5px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.alh-stream-server:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.24);
	transform: translateY(-1px);
}

.alh-stream-server.is-active {
	background: linear-gradient(135deg, var(--st-accent), #c81e2f);
	border-color: rgba(255, 255, 255, 0.18);
	color: #fff;
	box-shadow: 0 8px 18px rgba(230, 57, 70, 0.35);
}

.alh-stream-server-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #34d399;
	box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.alh-stream-server.is-active .alh-stream-server-dot {
	background: #fff;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.alh-stream-server-tag {
	padding: 1px 5px;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.16);
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.4px;
}

/* Stage ------------------------------------------------------------------ */

.alh-stream-stage {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.alh-stream-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.alh-stream-frame iframe,
.alh-stream-frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}

.alh-stream-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: rgba(255, 255, 255, 0.75);
	font-size: 12.5px;
	font-weight: 600;
	background: radial-gradient(600px 240px at 50% 30%, rgba(230, 57, 70, 0.18), transparent 70%), #050a18;
}

.alh-stream-spinner {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.18);
	border-top-color: var(--st-accent);
	animation: alh-stream-spin 0.9s linear infinite;
}

@keyframes alh-stream-spin {
	to { transform: rotate(360deg); }
}

.alh-stream-error {
	position: absolute;
	inset: auto 12px 12px;
	z-index: 3;
	padding: 8px 12px;
	border-radius: 10px;
	background: rgba(239, 68, 68, 0.92);
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	text-align: center;
}

/* Ad shield -------------------------------------------------------------- */

.alh-stream-shield {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: start center;
	padding-top: 12px;
	background: transparent;
	cursor: not-allowed;
}

.alh-stream-shield[hidden] {
	display: none;
}

.alh-stream-shield-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(8, 14, 30, 0.82);
	color: rgba(255, 255, 255, 0.9);
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: background 0.2s ease, border-color 0.2s ease;
}

.alh-stream-shield-pill:hover {
	background: var(--st-accent);
	border-color: var(--st-accent);
	color: #fff;
}

/* Foot ------------------------------------------------------------------- */

.alh-stream-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.alh-stream-tools {
	display: flex;
	gap: 6px;
	flex: 0 0 auto;
}

.alh-stream-tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	border: 1px solid var(--st-line);
	background: rgba(255, 255, 255, 0.055);
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.alh-stream-tool:hover {
	background: rgba(255, 255, 255, 0.13);
}

.alh-stream-tool.is-on {
	background: rgba(52, 211, 153, 0.16);
	border-color: rgba(52, 211, 153, 0.45);
	color: #6ee7b7;
}

.alh-stream-note {
	margin: 0;
	flex: 1 1 240px;
	font-size: 10.5px;
	line-height: 1.75;
	color: rgba(255, 255, 255, 0.45);
	text-align: start;
}

/* Countdown -------------------------------------------------------------- */

.alh-stream--soon {
	padding: 18px;
}

.alh-stream-soon {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.alh-stream-soon-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	background: rgba(230, 57, 70, 0.16);
	border: 1px solid rgba(230, 57, 70, 0.3);
	color: var(--st-accent);
	flex: 0 0 auto;
}

.alh-stream-soon-copy {
	flex: 1 1 240px;
	min-width: 0;
}

.alh-stream-soon-copy h2 {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 800;
	color: #fff;
}

.alh-stream-soon-copy p {
	margin: 0;
	font-size: 12px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.62);
}

.alh-stream-countdown {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--st-line);
	font-variant-numeric: tabular-nums;
	font-size: 18px;
	font-weight: 800;
	color: #fff;
}

.alh-stream-countdown i {
	font-style: normal;
	color: rgba(255, 255, 255, 0.4);
}

.alh-stream-countdown span {
	min-width: 22px;
	text-align: center;
}

/* Fullscreen ------------------------------------------------------------- */

.alh-stream-stage:fullscreen {
	aspect-ratio: auto;
	background: #000;
	border-radius: 0;
}

.alh-stream-stage:fullscreen .alh-stream-frame {
	position: fixed;
	inset: 0;
}

.alh-stream-stage:fullscreen .alh-stream-frame iframe,
.alh-stream-stage:fullscreen .alh-stream-frame video {
	width: 100%;
	height: 100%;
}

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

@media (max-width: 720px) {
	.alh-stream {
		padding: 12px;
		border-radius: 18px;
		margin-top: 20px;
	}

	.alh-stream-head {
		flex-wrap: wrap;
		gap: 4px;
	}

	.alh-stream-match {
		width: 100%;
		white-space: normal;
	}

	.alh-stream-title {
		font-size: 14px;
	}

	.alh-stream-serversbar {
		flex-wrap: wrap;
		gap: 6px;
		padding: 6px;
	}

	.alh-stream-servers-label {
		width: 100%;
		padding: 0 4px;
	}

	.alh-stream-server {
		padding: 7px 11px;
		font-size: 11px;
	}

	.alh-stream-note {
		font-size: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.alh-stream-spinner,
	.alh-stream-live i {
		animation: none;
	}

	.alh-stream-server,
	.alh-stream-tool {
		transition: none;
	}
}
