/* TTX Secure Player — أنماط المشغّل الآمن والمساحات الإعلانية */

.ttx-splayer {
	display: grid;
	gap: 14px;
	margin-block-end: 22px;
}

.ttx-splayer__stage {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #0b0d14;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 18px 48px rgb(0 0 0 / 45%);
}

.ttx-splayer__cover {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	cursor: pointer;
}

.ttx-splayer__cover img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: brightness( 0.6 );
}

.ttx-splayer__play {
	position: relative;
	z-index: 2;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 18px 26px;
	color: #fff;
	background: rgb(0 0 0 / 45%);
	border: 2px solid rgb(255 255 255 / 55%);
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	backdrop-filter: blur( 6px );
	transition: transform .18s ease, background .18s ease;
}

.ttx-splayer__play:hover,
.ttx-splayer__play:focus-visible {
	transform: scale( 1.06 );
	background: var( --ttx-accent, #7c5cff );
	border-color: transparent;
}

.ttx-splayer__loader,
.ttx-splayer__error {
	position: absolute;
	z-index: 3;
	inset-block-end: 18px;
	inset-inline: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0;
	padding: 10px 14px;
	color: #fff;
	background: rgb(0 0 0 / 72%);
	border-radius: 10px;
	font-size: 14px;
	text-align: center;
}

.ttx-splayer__error {
	background: rgb(150 24 40 / 88%);
}

.ttx-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgb(255 255 255 / 35%);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ttx-spin .8s linear infinite;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.ttx-spinner { animation-duration: 3s; }
	.ttx-splayer__play { transition: none; }
}

.ttx-splayer__frame,
.ttx-splayer__frame iframe,
.ttx-fs__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ttx-fs__video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.ttx-splayer__fs {
	position: absolute;
	z-index: 4;
	inset-block-end: 12px;
	inset-inline-start: 12px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	color: #fff;
	background: rgb(0 0 0 / 55%);
	border: 0;
	border-radius: 9px;
	cursor: pointer;
}

.ttx-splayer__fs:hover {
	background: var( --ttx-accent, #7c5cff );
}

/* السيرفرات */
.ttx-splayer__servers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.ttx-splayer__label {
	font-weight: 700;
	opacity: .75;
}

.ttx-splayer__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ttx-server {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	color: inherit;
	background: rgb(255 255 255 / 6%);
	border: 1px solid rgb(255 255 255 / 12%);
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: background .16s ease, border-color .16s ease;
}

.ttx-server:hover {
	background: rgb(255 255 255 / 12%);
}

.ttx-server.is-active {
	background: var( --ttx-accent, #7c5cff );
	border-color: transparent;
	color: #fff;
	font-weight: 700;
}

.ttx-server__q {
	font-size: 11px;
	opacity: .8;
}

/* الإعلانات */
.ttx-ad {
	display: flex;
	justify-content: center;
	min-height: 0;
}

.ttx-ad:empty {
	display: none;
}

.ttx-ad__frame {
	width: 100%;
	max-width: 728px;
	height: 100px;
	border: 0;
}

.ttx-fs__side .ttx-ad__frame {
	width: 300px;
	max-width: 300px;
	height: 600px;
}

/* وضع التكبير المخصص */
.ttx-fs {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	grid-template-rows: 1fr auto;
	gap: 12px;
	padding: 16px;
	background: #05060a;
}

.ttx-fs[hidden] {
	display: none;
}

.ttx-fs__row {
	display: grid;
	grid-template-columns: auto minmax( 0, 1fr ) auto;
	align-items: center;
	gap: 16px;
	min-height: 0;
}

.ttx-fs__center {
	display: grid;
	gap: 10px;
	justify-items: center;
	width: 100%;
}

.ttx-fs__side {
	display: grid;
	place-items: center;
}

.ttx-fs__side:empty {
	display: none;
}

.ttx-fs__bottom:empty {
	display: none;
}

.ttx-fs__close {
	padding: 9px 18px;
	color: #fff;
	background: rgb(255 255 255 / 12%);
	border: 0;
	border-radius: 999px;
	font: inherit;
	cursor: pointer;
}

.ttx-fs__close:hover {
	background: var( --ttx-accent, #7c5cff );
}

body.ttx-fs-open {
	overflow: hidden;
}

@media ( max-width: 1100px ) {
	.ttx-fs__row {
		grid-template-columns: minmax( 0, 1fr );
	}
	.ttx-fs__side {
		display: none;
	}
}
