/* AtiDrama — lecteur vertical, grille d'épisodes, écran verrouillé, annonce démo. */

.ati-player,
.ati-eps-grid,
.ati-eps-tabs,
.ati-rw-stage {
	--_accent: var(--ati-accent, #e0136f);
	--_accent2: var(--ati-accent-2, #ff3d8b);
	--_grad: var(--ati-grad, linear-gradient(135deg, #ea1d7b, #c90f5f));
	--_bg: var(--ati-bg, #0e0b12);
	--_surface: var(--ati-surface, #1b1621);
	--_surface2: var(--ati-surface-2, #2a2430);
	--_text: var(--ati-text, #f6f3f8);
	--_muted: var(--ati-muted, #8f8799);
	--_pill-bg: var(--ati-pill-bg, #f8dfea);
	--_pill-text: var(--ati-pill-text, #5a1336);
	--_radius: var(--ati-radius, 14px);
}

.ati-player svg,
.ati-eps-grid svg { width: 1em; height: 1em; fill: currentColor; display: block; }
.ati-player [hidden] { display: none !important; }

/* ------------------------------------------------------------------ */
/* Mise en page                                                        */
/* ------------------------------------------------------------------ */
.ati-player {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: #000;
	color: var(--_text);
	display: flex;
	overflow: hidden;
	overflow: clip; /* empêche tout défilement interne (focus, panneau caché) */
}
.ati-stage {
	position: relative;
	flex: 1;
	background: #000;
	overflow: hidden;
	overflow: clip;
	touch-action: pan-x;
	-webkit-user-select: none;
	user-select: none;
}
.ati-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
}
.ati-tap { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.ati-ad-slot { position: absolute; inset: 0; z-index: 30; background: #000; }

@media (min-width: 900px) {
	.ati-player {
		position: relative;
		inset: auto;
		z-index: 1;
		background: transparent;
		gap: 24px;
		justify-content: center;
		align-items: stretch;
		height: calc(100vh - var(--ati-header-h, 72px) - 48px);
		min-height: 560px;
		margin: 24px auto;
		max-width: 1200px;
		padding: 0 24px;
	}
	.ati-stage {
		flex: 0 0 auto;
		height: 100%;
		aspect-ratio: 9 / 16;
		border-radius: var(--_radius);
		box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
	}
}

/* ------------------------------------------------------------------ */
/* Interface par-dessus la vidéo                                       */
/* ------------------------------------------------------------------ */
.ati-hud-top {
	position: absolute;
	top: 0; left: 0; right: 0;
	z-index: 12; /* reste cliquable au-dessus de l'écran verrouillé */
	display: flex;
	align-items: center;
	gap: 10px;
	padding: max(12px, env(safe-area-inset-top)) 14px 28px;
	background: linear-gradient(rgba(0, 0, 0, .65), transparent);
	pointer-events: none;
}
.ati-hud-top > * { pointer-events: auto; }
.ati-hud-title { min-width: 0; line-height: 1.2; }
.ati-hud-ep { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.ati-hud-ep small { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .6); }

.ati-icon-btn {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 38px; height: 38px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	text-decoration: none;
}
.ati-icon-btn:hover { background: rgba(255, 255, 255, .15); }

.ati-hud-side {
	position: absolute;
	right: 8px;
	bottom: 150px;
	z-index: 6;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.ati-side-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	border: 0;
	background: none;
	color: #fff;
	font: 600 11px/1.2 inherit;
	cursor: pointer;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
	padding: 0;
}
.ati-side-btn { min-width: 52px; font-weight: 500; }
.ati-side-btn svg {
	width: 30px; height: 30px;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6));
}
.ati-fav .ati-fav-on { display: none; }
.ati-fav.is-on .ati-fav-off { display: none; }
.ati-fav.is-on .ati-fav-on { display: inline; }
.ati-fav.is-on svg { fill: var(--_accent2); }
@media (min-width: 900px) { .ati-open-eps { display: none !important; } }

.ati-hud-bottom {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	z-index: 5;
	padding: 60px 16px max(12px, env(safe-area-inset-bottom));
	background: linear-gradient(transparent, rgba(0, 0, 0, .45) 35%, rgba(0, 0, 0, .78));
	pointer-events: none;
}
.ati-hud-info { max-width: calc(100% - 64px); margin-bottom: 12px; pointer-events: auto; }
.ati-hud-drama {
	display: block;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.ati-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ati-pill {
	display: inline-block;
	padding: 3px 7px;
	border-radius: 4px;
	background: var(--_pill-bg);
	color: var(--_pill-text);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.ati-hud-synopsis {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	color: rgba(255, 255, 255, .78);
	font-size: 13.5px;
	line-height: 1.45;
	cursor: pointer;
}
.ati-hud-synopsis.is-open { -webkit-line-clamp: 8; }
.ati-progress {
	height: 14px;
	display: flex;
	align-items: center;
	cursor: pointer;
	pointer-events: auto;
}
.ati-progress::before {
	content: "";
	position: absolute;
	left: 16px; right: 16px;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .25);
}
.ati-progress-bar {
	position: relative;
	height: 3px;
	width: 0;
	border-radius: 3px;
	background: var(--_grad);
	transition: width .25s linear;
}

.ati-spinner {
	position: absolute;
	top: 50%; left: 50%;
	z-index: 4;
	width: 46px; height: 46px;
	margin: -23px 0 0 -23px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .2);
	border-top-color: #fff;
	animation: ati-spin .8s linear infinite;
	pointer-events: none;
}
@keyframes ati-spin { to { transform: rotate(360deg); } }

.ati-paused-icon {
	position: absolute;
	top: 50%; left: 50%;
	z-index: 4;
	width: 76px; height: 76px;
	margin: -38px 0 0 -38px;
	padding: 18px 16px 18px 22px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	pointer-events: none;
}
.ati-paused-icon svg { width: 100%; height: 100%; }

.ati-unmute {
	position: absolute;
	top: 76px; left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	border: 0;
	border-radius: 999px;
	padding: 9px 16px;
	background: rgba(255, 255, 255, .92);
	color: #111;
	font: 600 13px/1 inherit;
	cursor: pointer;
	white-space: nowrap;
}

.ati-toast {
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	z-index: 40;
	max-width: 80%;
	padding: 12px 18px;
	border-radius: 12px;
	background: rgba(20, 20, 28, .92);
	color: #fff;
	font-weight: 600;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
	animation: ati-pop .25s ease-out;
}
@keyframes ati-pop { from { opacity: 0; transform: translate(-50%, -40%); } }

/* ------------------------------------------------------------------ */
/* Écran « épisode verrouillé »                                        */
/* ------------------------------------------------------------------ */
.ati-lock {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: grid;
	place-items: center;
	padding: 24px;
	background: radial-gradient(ellipse at center, rgba(10, 10, 16, .55), rgba(10, 10, 16, .92));
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}
.ati-lock-box { width: 100%; max-width: 320px; text-align: center; }
.ati-lock-icon {
	width: 64px; height: 64px;
	margin: 0 auto 16px;
	padding: 16px;
	border-radius: 50%;
	background: var(--_grad);
	color: #fff;
	box-shadow: 0 10px 30px color-mix(in srgb, var(--_accent) 45%, transparent);
}
.ati-lock-icon svg { width: 100%; height: 100%; }
.ati-lock-title { margin: 0 0 8px; font-size: 21px; line-height: 1.25; color: #fff; }
.ati-lock-text { margin: 0 0 20px; color: rgba(255, 255, 255, .8); font-size: 15px; line-height: 1.45; }
.ati-lock-msg { min-height: 1em; margin: 14px 0 0; color: #ffd36b; font-size: 13.5px; line-height: 1.4; }
.ati-lock-msg:empty { display: none; }
.ati-lock-small { margin: 14px 0 0; color: rgba(255, 255, 255, .55); font-size: 12px; }
.ati-lock-list {
	margin-top: 18px;
	border: 0;
	background: none;
	color: rgba(255, 255, 255, .8);
	font: 600 14px/1 inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
@media (min-width: 900px) { .ati-lock-list { display: none; } }

.ati-player .ati-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	border-radius: 10px;
	padding: 14px 26px;
	font: 700 15px/1 inherit;
	cursor: pointer;
	text-decoration: none;
	transition: transform .15s, opacity .15s, box-shadow .15s;
}
.ati-player .ati-btn svg { width: 18px; height: 18px; fill: currentColor; }
.ati-player .ati-btn-primary { background: var(--_grad); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--_accent) 35%, transparent); }
.ati-player .ati-btn-primary:hover { transform: translateY(-1px); }
.ati-player .ati-btn[disabled] { opacity: .7; cursor: wait; transform: none; }
.ati-player .ati-watch-ad { width: 100%; padding: 16px 20px; font-size: 16px; }
.ati-player .ati-btn-key {
	width: 100%;
	margin-top: 10px;
	padding: 12px 20px;
	flex-wrap: wrap;
	gap: 2px 8px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 15px;
}
.ati-player .ati-btn-key:hover { background: rgba(255, 255, 255, .2); }
.ati-player .ati-btn-key svg { color: #ffd36b; }
.ati-player .ati-btn-key small { flex-basis: 100%; color: rgba(255, 255, 255, .65); font-size: 12px; font-weight: 500; }
.ati-earn-keys { display: inline-block; margin-top: 12px; color: #ffd36b; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.ati-earn-keys:hover { text-decoration: underline; }
/* Annonce bonus (page « Récompenses ») : plein écran */
.ati-rw-stage { position: fixed; inset: 0; z-index: 3000; background: #000; }
.ati-rw-video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.ati-btn-spin {
	width: 16px; height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	animation: ati-spin .8s linear infinite;
}

/* ------------------------------------------------------------------ */
/* Annonce de démonstration                                            */
/* ------------------------------------------------------------------ */
.ati-demo-ad {
	position: absolute;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	background: linear-gradient(160deg, #1b1430, #0d0d14 60%);
	color: #fff;
	animation: ati-fade .2s ease-out;
}
@keyframes ati-fade { from { opacity: 0; } }
.ati-demo-top {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: max(14px, env(safe-area-inset-top)) 14px 14px;
}
.ati-demo-label {
	padding: 4px 8px;
	border-radius: 6px;
	background: #ffd36b;
	color: #222;
	font: 800 11px/1 inherit;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.ati-demo-count { flex: 1; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.ati-demo-ad.is-done .ati-demo-count { color: #6ee7a8; }
.ati-demo-close {
	width: 36px; height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.ati-demo-ad.is-done .ati-demo-close { background: #fff; color: #111; }
.ati-demo-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px;
	text-align: center;
}
.ati-demo-body strong { font-size: 18px; }
.ati-demo-body p { margin: 0; color: rgba(255, 255, 255, .65); font-size: 14px; max-width: 260px; }
.ati-demo-logo {
	width: 110px; height: 110px;
	display: grid;
	place-items: center;
	margin-bottom: 8px;
	border-radius: 28px;
	background: var(--_grad);
	font: 900 34px/1 inherit;
	letter-spacing: .05em;
	animation: ati-breathe 2.4s ease-in-out infinite;
}
@keyframes ati-breathe { 50% { transform: scale(1.06); } }
.ati-demo-bar { height: 4px; background: rgba(255, 255, 255, .12); }
.ati-demo-bar i { display: block; height: 100%; width: 0; background: #ffd36b; transition: width .25s linear; }

/* ------------------------------------------------------------------ */
/* Panneau et grille d'épisodes                                        */
/* ------------------------------------------------------------------ */
.ati-eps-panel {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	z-index: 60;
	max-height: 72vh;
	display: flex;
	flex-direction: column;
	padding: 18px 16px max(16px, env(safe-area-inset-bottom));
	border-radius: 20px 20px 0 0;
	background: var(--_surface);
	transform: translateY(105%);
	transition: transform .3s cubic-bezier(.2, .8, .2, 1);
	box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
}
.ati-player.is-panel-open .ati-eps-panel { transform: none; }
.ati-eps-head { position: relative; display: flex; flex-direction: column; gap: 3px; padding-right: 44px; margin-bottom: 14px; }
.ati-eps-head strong { font-size: 17px; }
.ati-eps-head span { color: var(--_muted); font-size: 13px; }
.ati-eps-head .ati-close-eps { position: absolute; top: -4px; right: 0; background: var(--_surface2); font-size: 20px; }
.ati-eps-panel .ati-eps-grid { overflow-y: auto; padding-bottom: 6px; }

@media (min-width: 900px) {
	.ati-eps-panel {
		position: relative;
		inset: auto;
		flex: 0 1 380px;
		max-height: none;
		transform: none;
		border-radius: var(--_radius);
		box-shadow: none;
		padding: 22px;
	}
	.ati-eps-head .ati-close-eps { display: none; }
}

.ati-eps-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.ati-eps-tabs::-webkit-scrollbar { display: none; }
.ati-eps-tab {
	flex: 0 0 auto;
	border: 0;
	border-radius: 999px;
	padding: 7px 14px;
	background: var(--_surface2);
	color: var(--_muted);
	font: 600 13px/1 inherit;
	cursor: pointer;
}
.ati-eps-tab.is-active { background: var(--_accent); color: #fff; }

.ati-eps-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
	gap: 8px;
}
.ati-ep {
	position: relative;
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .06);
	border-radius: 10px;
	background: var(--_surface2);
	color: var(--_text);
	font: 700 15px/1 inherit;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, transform .15s;
}
.ati-ep:hover { background: color-mix(in srgb, var(--_surface2) 70%, #fff 12%); transform: translateY(-1px); }
.ati-ep.is-locked { color: var(--_muted); }
.ati-ep-lock {
	position: absolute;
	top: 5px; right: 5px;
	font-size: 11px;
	color: var(--_muted);
}
.ati-ep.is-current { background: var(--_grad); color: #fff; }
.ati-ep.is-current .ati-ep-n { opacity: 0; }
.ati-ep-playing { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: #fff; }
.ati-ep.is-current.is-locked .ati-ep-lock { color: #fff; }
