/*
Theme Name: Anisalt
Theme URI: https://anisalt.xxx/
Author: Custom Build
Description: Anime and cartoon catalog theme with season and episode management, TMDB/MAL/AniList metadata and responsive layouts.
Version: 1.3.5
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: animesalt-clone
*/

:root {
	--as-body: #09090b;
	--as-text: #94a3b8;
	--as-link: #94a3b8;
	--as-link-hover: #28c2bd;
	--as-primary: #9333ea;
	--as-primary-light: #a855f7;
	--as-secondary: #ec4899;
	--as-dark: #181832;
	--as-gray: #181832;
	--as-light: #94a3b8;
	--as-light-text: #f8fafc;
	--as-light-1: #181834;
	--as-light-2: #181834;
	--as-border: #222233;
	--as-primary-glow: rgba(147, 51, 234, 0.4);
	--as-size: 1rem;
	--as-f-size: 1rem;
	--as-nav-height: 80px;
	--as-nav-max-width: 1200px;
	--as-radius: 12px;
	--as-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
	--as-font-body: "Work Sans", sans-serif;
	--as-font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

html {
	scroll-behavior: smooth;
	-webkit-tap-highlight-color: transparent;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--as-body);
	color: var(--as-text);
	font: 400 var(--as-f-size)/1.8 var(--as-font-body);
	min-height: 100vh;
	overflow-x: hidden;
	word-wrap: break-word;
	position: relative;
	-webkit-text-size-adjust: 100%;
}

/* Match animesalt.cx UI font cascade on inner UI blocks */
main,
header,
.nc,
button,
input,
select,
textarea {
	font-family: var(--as-font-ui);
}

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

img.is-loading {
	opacity: 0;
}

img.is-loaded {
	opacity: 1;
	transition: opacity 400ms ease, transform 0.4s ease-in-out, filter 0.4s ease-in-out;
}

figure {
	margin: 0;
}

button {
	cursor: pointer;
}

/* Container Widths Matching .cont Across Mobile, Laptop (1024px), Desktop (1440px), Large (1600px+) */
.as-container,
.as-header-inner {
	width: 100%;
	margin: 0 auto;
	padding: 0 16px;
}

@media (min-width: 992px) {
	.as-container,
	.as-header-inner {
		max-width: 1000px;
	}
}

@media (min-width: 1200px) {
	.as-container,
	.as-header-inner {
		max-width: 1130px;
	}
}

@media (min-width: 1600px) {
	.as-container,
	.as-header-inner {
		max-width: 1704px;
	}
}

/* Cosmic Starfield Top & Bottom Atmospheric Backdrops (.bghd / .bgft) */
.as-bghd,
.as-bgft {
	position: absolute;
	width: 100vw;
	left: calc(50% - 50vw);
	z-index: -1;
	height: 50%;
	pointer-events: none;
	max-height: 50vh;
	overflow: hidden;
}

.as-bghd {
	top: 0;
}

.as-bghd img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 20%;
	opacity: 0.7;
	z-index: -1;
}

.as-bghd::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 10rem;
	background: linear-gradient(var(--as-body) 0%, rgba(0, 0, 0, 0) 100%);
}

.as-bghd::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(rgba(0, 0, 0, 0) 0%, var(--as-body) 100%);
}

.as-bgft {
	bottom: 0;
}

.as-bgft img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 20%;
	opacity: 0.2;
	filter: grayscale(1);
	z-index: -1;
}

/* Header: Static 48px centered logo on Home, Sticky 80px header on inner pages */
.as-header--home {
	position: static;
	padding: 0;
	margin: 0;
	z-index: 10;
}

.as-header--home .as-header-inner {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 48px;
}

.as-header--sticky {
	position: sticky;
	top: 0;
	z-index: 10;
	padding: 1rem 0;
	margin-bottom: 1rem;
	transition: 0.4s;
}

.as-header--sticky::before {
	content: "";
	position: absolute;
	left: calc(50% - 50vw);
	width: 100vw;
	top: 0;
	height: 150%;
	z-index: -1;
	background: linear-gradient(to bottom, var(--as-body) 0%, rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
}

.as-header--sticky .as-header-inner {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	height: 48px;
}

.as-logo-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.as-logo-link img {
	height: 3rem;
	width: auto;
}

@media (min-width: 992px) and (max-width: 1599px) {
	.as-header--sticky .as-logo-link img {
		max-width: 10rem;
		object-fit: contain;
	}
}

.as-logo-mark {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
}

.as-logo-wordmark {
	font-size: 25px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1;
	color: #ffffff;
}

.as-logo-wordmark span {
	color: #c026d3;
	background: linear-gradient(90deg, #a855f7, #d946ef);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* Exact Fixed Floating Bottom Navigation (.nc > .nb > .ni) - 80px across all viewports */
@keyframes asNavBounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-2px); }
}

@keyframes asReelSpin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.nc {
	position: fixed;
	bottom: 0;
	right: 0;
	width: 100%;
	height: var(--as-nav-height);
	background-color: #09090b;
	border-radius: 25px 25px 0 0;
	box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.2);
	z-index: 100;
	padding: 0 10px;
}

.nb {
	display: flex;
	justify-content: space-around;
	align-items: center;
	height: 100%;
	max-width: var(--as-nav-max-width);
	margin: 0 auto;
}

.ni {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #777777;
	width: 16.66%;
	height: 100%;
	transition: all 0.3s ease;
	cursor: pointer;
	overflow: visible;
}

.ni:hover {
	color: #aaaaaa;
}

.ni:hover .nl {
	transform: translateY(-1px);
}

.ni:hover .mi .mro {
	transform-origin: center;
	animation: asReelSpin 3s linear infinite;
}

.ni.a {
	color: #ffffff;
}

.ni.a .hr {
	animation: asNavBounce 1s ease infinite;
}

.nic {
	position: relative;
	width: 36px;
	height: 36px;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 5px;
}

.nl {
	font-size: 12px;
	font-weight: 500;
	line-height: 21.6px;
	transition: transform 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ni.a::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 6px;
	height: 6px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff;
}

.ni.a::after {
	content: "";
	position: absolute;
	bottom: 65%;
	left: 50%;
	transform: translateX(-50%);
	width: 45px;
	height: 45px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 50%;
	box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
	z-index: -1;
}

/* Exact Language Selector (#aas-anime_language_selector_widget-2) & Audio Wave Overlay */
@keyframes alsSelectorShine {
	0% { opacity: 0; transform: translateX(-100%) rotate(45deg); }
	50% { opacity: 0.7; }
	100% { opacity: 0; transform: translateX(100%) rotate(45deg); }
}

@keyframes asPulse {
	0% { box-shadow: 0 0 0 0 rgba(255, 94, 125, 0.7); }
	70% { box-shadow: 0 0 0 5px rgba(255, 94, 125, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 94, 125, 0); }
}

@keyframes asSoundWave {
	0%, 100% { height: 10px; }
	50% { height: 28px; }
}

#aas-anime_language_selector_widget-2 {
	--primary: #6a3de8;
	--primary-light: #9370ff;
	--secondary: #ff5e7d;
	--dark: #121212;
	--darker: #0a0a0a;
	color: #f0f0f0;
	border-radius: 8px;
	overflow: hidden;
	position: relative;
	padding: 0.8rem 0.3rem;
	margin: 0 auto 1rem;
	text-align: center;
}

.as-selected-lang-row {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 14px;
	color: var(--as-text);
}

.as-selected-lang-pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.55rem;
	background-color: rgba(106, 61, 232, 0.2);
	border-radius: 12px;
	border: 1px solid rgba(106, 61, 232, 0.3);
	font-weight: 600;
	color: #9370ff;
	font-size: 13px;
}

.as-selected-lang-pill::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	background-color: #ff5e7d;
	border-radius: 50%;
	margin-right: 0.4rem;
	animation: asPulse 2s infinite;
}

.as-lang-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.5rem;
}

@media (min-width: 768px) {
	.as-lang-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.as-lang-btn {
	background-color: rgba(20, 20, 25, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #f0f0f0;
	padding: 0.5rem 0.3rem;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
	line-height: 1rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.as-lang-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
	border-color: rgba(255, 255, 255, 0.2);
}

.as-lang-btn:active {
	transform: translateY(0);
}

.as-lang-btn::after {
	content: "";
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	transform: rotate(45deg);
	transition: all 0.5s ease;
	opacity: 0;
}

.as-lang-btn:hover::after {
	animation: alsSelectorShine 1.5s;
}

.as-lang-btn.active {
	border-color: rgba(147, 112, 255, 0.6);
	box-shadow: 0 0 14px rgba(106, 61, 232, 0.28);
}

.as-lang-en {
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 0.1rem;
	color: #f0f0f0;
}

.as-lang-native {
	font-size: 0.7rem;
	opacity: 0.7;
}

@media (max-width: 400px) {
	.as-lang-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 0.2rem;
	}

	.as-lang-btn {
		padding: 0.25rem 0.1rem;
		border-radius: 8px;
	}

	.as-lang-en {
		font-size: 0.6rem;
		line-height: 1.25;
	}

	.as-lang-native {
		font-size: 0.5rem;
		line-height: 1.2;
	}
}

/* Language Selection Modal Overlay */
.selection-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.selection-overlay.active {
	opacity: 1;
	visibility: visible;
}

.selection-content {
	text-align: center;
	padding: 2rem;
	background: linear-gradient(135deg, #121212, #0a0a0a);
	border-radius: 15px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	transform: translateY(20px);
	opacity: 0;
	transition: all 0.4s ease-out;
	border: 1px solid rgba(255, 255, 255, 0.1);
	max-width: 400px;
	width: 80%;
}

.selection-overlay.active .selection-content {
	transform: translateY(0);
	opacity: 1;
}

.audio-wave {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
	height: 32px;
	margin-bottom: 14px;
}

.audio-wave span {
	display: block;
	width: 4px;
	height: 12px;
	border-radius: 999px;
	background: linear-gradient(180deg, #a855f7, #ec4899);
	animation: asSoundWave 0.8s ease-in-out infinite;
}

.audio-wave span:nth-child(2) { animation-delay: 0.12s; }
.audio-wave span:nth-child(3) { animation-delay: 0.24s; }
.audio-wave span:nth-child(4) { animation-delay: 0.36s; }
.audio-wave span:nth-child(5) { animation-delay: 0.48s; }

.selection-kicker {
	margin: 0 0 4px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--as-text);
}

.selection-lang-name {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	color: #ffffff;
}

.selection-sub {
	margin: 0;
	font-size: 13px;
	color: #a855f7;
}

/* Networks Grid (gs-logo-slider exact 12.5% / 25% spacing & clean tiles) */
.as-networks-section {
	margin: 12px 0 32px;
	text-align: center;
}

.as-networks-title {
	display: inline-block;
	font-size: 16px;
	font-weight: 700;
	color: #e4e4e7;
	margin: 0 0 14px;
	padding-bottom: 4px;
	border-bottom: 2px solid var(--as-primary);
}

.as-networks-grid {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-left: -5px;
	margin-right: -5px;
}

.as-network-tile {
	width: 12.5%;
	padding: 5px;
	display: block;
}

@media (max-width: 1023px) {
	.as-network-tile {
		width: 25%;
	}
}

.as-network-tile img,
.as-network-fallback {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 14px;
	overflow: hidden;
	transition: all 0.25s ease-in-out;
}

.as-network-tile img {
	object-fit: cover;
}

.as-network-tile:hover img,
.as-network-tile:hover .as-network-fallback {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(147, 51, 234, 0.28);
}

.as-network-fallback {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 11px;
	line-height: 1.15;
	text-align: center;
	color: #ffffff;
	padding: 6px;
}

/* Animated Gradient Section Headers */
@keyframes asGradientFlow {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

.as-section {
	margin-bottom: 2rem;
}

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

.as-section-title {
	position: relative;
	display: inline-block;
	margin: 0;
	padding: 8px 0 8px 0.7rem;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 2rem;
	color: var(--as-text);
}

@media (min-width: 768px) {
	.as-section-title {
		font-size: 1.5rem;
	}
}

.as-section-title::after {
	content: "";
	position: absolute;
	top: 10px;
	left: 0.2rem;
	width: 2px;
	height: 30px;
	border-radius: 2px;
	background: linear-gradient(-45deg, var(--as-primary), var(--as-secondary), var(--as-primary-light), var(--as-secondary));
	background-size: 200% 200%;
	animation: asGradientFlow 2s ease infinite;
}

.as-section-title--plain {
	padding-left: 0;
}

.as-section-title--plain::after {
	display: none;
}

.as-view-more {
	font-size: 12px;
	font-weight: 700;
	color: #e4e4e7;
	white-space: nowrap;
}

.as-view-more:hover {
	color: var(--as-primary-light);
}

.as-history-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.as-history-icon-btn {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(17, 24, 39, 0.6);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.as-history-icon-btn--edit {
	color: #a855f7;
}

.as-history-icon-btn--edit.active,
.as-history-icon-btn--edit:hover {
	background: rgba(147, 51, 234, 0.25);
	border-color: #a855f7;
}

.as-history-icon-btn--clear {
	color: #f43f5e;
}

.as-history-icon-btn--clear:hover {
	background: rgba(244, 63, 94, 0.2);
	border-color: #f43f5e;
}

/* Most-Watched Chart Row (exact .chart-content & .chart-item) */
.as-chart-content {
	display: flex;
	overflow-x: auto;
	padding: 10px 0;
	scroll-snap-type: x mandatory;
	gap: 7px;
	width: 100%;
	scrollbar-width: thin;
	scrollbar-color: #71717a #18181b;
}

.as-chart-content::-webkit-scrollbar {
	height: 7px;
}

.as-chart-content::-webkit-scrollbar-track {
	background: #18181b;
	border-radius: 999px;
}

.as-chart-content::-webkit-scrollbar-thumb {
	background: #52525b;
	border-radius: 999px;
}

.as-chart-item {
	flex: 0 0 auto;
	width: calc(40% - 10px);
	position: relative;
	scroll-snap-align: start;
}

@media (min-width: 768px) {
	.as-chart-item {
		width: calc(19.5% - 12.5px);
	}
}

.as-chart-item .as-poster-box {
	border-radius: 8px;
}

.as-chart-item .as-card-title {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-align: left;
}

.as-rank-num {
	position: absolute;
	bottom: 5px;
	left: 5px;
	font-size: 36px;
	font-weight: 700;
	color: #ffffff;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
	line-height: 1;
	z-index: 3;
	font-family: Arial, sans-serif;
	pointer-events: none;
}

/* Horizontal Scrollers (3.3 cards on mobile, 5.4 cards on laptop/desktop) */
.as-scroll-row {
	display: flex;
	gap: 7px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	padding-bottom: 8px;
	scrollbar-width: none;
}

@media (min-width: 768px) {
	.as-scroll-row {
		gap: 10px;
	}
}

.as-scroll-row::-webkit-scrollbar {
	display: none;
}

/* Poster Cards & Exact Torofilm .post Hover Physics */
.as-card {
	position: relative;
	flex: 0 0 calc(30.3% - 5px);
	scroll-snap-align: start;
	display: block;
}

@media (min-width: 768px) {
	.as-card {
		flex: 0 0 calc(18.5% - 8px);
	}
}

.as-grid .as-card {
	flex: initial;
	width: 100%;
	min-width: 0;
}

.as-lnk-blk::after {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	content: "";
	z-index: 4;
}

.as-poster-box {
	position: relative;
	width: 100%;
	border-radius: 0.2rem;
	overflow: hidden;
	background: #161622;
}

.as-poster-box figure {
	position: relative;
	overflow: hidden;
	border-radius: 0.2rem;
}

.as-poster-box figure::before {
	content: "";
	padding-top: 150%;
	display: block;
}

.as-poster-box figure img {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100% !important;
	border-radius: 0.2rem;
	object-fit: cover;
	transition: all 0.4s ease-in-out;
}

.as-play-circle {
	width: 3.4rem;
	height: 3.4rem;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	inset: 0;
	margin: auto;
	color: #ffffff;
	padding-left: 3px;
	transform: scale(0.5);
	opacity: 0;
	transition: all 0.4s ease-in-out;
	z-index: 3;
	pointer-events: none;
}

.as-post:hover .as-poster-box figure img,
.as-post:hover .as-ep-thumb figure img {
	transform: scale(1.3);
	filter: blur(3px);
	opacity: 0.3;
}

.as-post:hover .as-play-circle {
	opacity: 1;
	transform: scale(1);
}

.as-post:hover .as-badge-tl,
.as-post:hover .as-badge-bl {
	left: -4rem;
	opacity: 0;
}

.as-card-title {
	margin: 6px 0 0;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.2;
	color: var(--as-light);
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.as-grid .as-card-title {
	-webkit-line-clamp: 2;
}

@media (max-width: 575px) {
	.as-grid .as-card-title {
		font-size: 0.75rem;
	}
}

.as-card:hover .as-card-title {
	color: #ffffff;
}

/* Badges on Fresh Drops & History */
.as-badge-tl,
.as-badge-bl {
	position: absolute;
	left: 0.5rem;
	z-index: 3;
	padding: 0 0.5rem;
	line-height: 1.4rem;
	border-radius: 0.2rem;
	background-color: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(20px);
	color: #f8fafc;
	font-size: 0.65rem;
	font-weight: 600;
	transition: all 0.4s ease-in-out;
}

.as-badge-tl {
	top: 0.5rem;
}

.as-badge-bl {
	bottom: 0.5rem;
}

.as-history-remove {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 6;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	color: #f43f5e;
	display: none;
	align-items: center;
	justify-content: center;
}

.is-editing .as-history-remove {
	display: inline-flex;
}

/* Exact Navigate A to Z (.az-lst) */
.as-az-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.as-az-btn {
	min-width: 2.5rem;
	height: 2.1rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	color: var(--as-text);
	font-size: 1rem;
	font-weight: 700;
	opacity: 0.5;
	transition: all 0.2s ease;
}

.as-az-btn:hover {
	opacity: 1;
	color: #ffffff;
}

.as-az-btn.active {
	opacity: 1;
	background-color: var(--as-gray);
	border-bottom-color: var(--as-primary);
	color: #ffffff;
}

/* Archive & Search Grid Matching .rcl2 / .rcl3c / .rcl4d / .rcl6e Breakpoints */
.as-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

@media (min-width: 1200px) {
	.as-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1600px) {
	.as-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.as-search-form {
	max-width: 37rem;
	margin: 10px auto 24px;
	position: relative;
}

.as-search-input {
	width: 100%;
	height: 44px;
	padding: 0 3rem 0 1.25rem;
	border-radius: 5rem;
	border: 2px solid #ffffff;
	background-color: rgba(255, 255, 255, 0.2);
	color: #ffffff;
	font-size: 1rem;
	outline: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.as-search-input::placeholder {
	color: rgba(255, 255, 255, 0.75);
}

.as-search-input:focus {
	background-color: var(--as-light-2);
	border-color: var(--as-primary-light);
}

.as-search-submit {
	position: absolute;
	right: 0;
	top: 0;
	height: 44px;
	width: 44px;
	border: none;
	background: transparent;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.as-filter-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 18px;
	list-style: none;
	text-transform: uppercase;
}

.as-filter-tab {
	display: block;
	line-height: 2rem;
	font-size: 1rem;
	color: var(--as-text);
	position: relative;
	opacity: 0.7;
	padding-bottom: 4px;
}

.as-filter-tab::before {
	height: 3px;
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 0;
	margin: auto;
	background-color: var(--as-primary);
	transition: 0.2s;
}

.as-filter-tab:hover {
	opacity: 1;
	color: #ffffff;
}

.as-filter-tab.active {
	color: #ffffff;
	opacity: 1;
}

.as-filter-tab.active::before {
	width: 100%;
}

/* Pagination */
.as-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 30px 0 12px;
}

.as-pagination .page-numbers {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #14141d;
	border: 1px solid var(--as-border);
	color: var(--as-text);
	font-weight: 600;
}

.as-pagination .page-numbers.current,
.as-pagination .page-numbers:hover {
	background: var(--as-primary);
	border-color: var(--as-primary-light);
	color: #ffffff;
}

/* Single Series / Movie Detail Hero */
.as-detail-backdrop {
	position: relative;
	width: 100%;
	min-height: 320px;
	padding-top: 24px;
	background-size: cover;
	background-position: center 20%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.as-detail-backdrop::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(9, 9, 11, 0.35) 0%, rgba(9, 9, 11, 0.72) 55%, var(--as-body) 100%);
}

.as-detail-poster-wrap {
	position: relative;
	z-index: 2;
	height: 14rem;
	aspect-ratio: 2 / 3;
	border-radius: 5%;
	overflow: hidden;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

.as-detail-poster-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.as-detail-title {
	position: relative;
	z-index: 2;
	margin: 18px 0 16px;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.5px;
	color: #94a3b8;
	text-align: center;
}

/* Exact .smart-buttons-container & .smart-play-btn */
.smart-buttons-container {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 0 4px;
	margin-bottom: 24px;
	flex-wrap: nowrap;
}

.smart-play-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(148, 163, 184, 0.1);
	border: 1.5px solid rgba(148, 163, 184, 0.3);
	color: #94a3b8;
	padding: 8px 10px;
	border-radius: 8px;
	font-weight: 500;
	font-size: 11px;
	flex: 1 1 0;
	min-width: 0;
	height: 50px;
	transition: all 0.3s ease;
	position: relative;
	white-space: nowrap;
}

.smart-play-btn .play-icon {
	height: 16px;
	width: 16px;
	flex-shrink: 0;
	margin-right: 8px;
	color: #94a3b8;
}

.smart-play-btn .action-text {
	display: block;
	line-height: 1.2;
	margin-bottom: 2px;
}

.smart-play-btn .episode-text {
	display: block;
	font-size: 9px;
	opacity: 0.9;
	line-height: 1;
}

.smart-play-btn:hover {
	transform: translateY(-0.5px);
	color: #ffffff;
	background: rgba(148, 163, 184, 0.15);
	border-color: rgba(148, 163, 184, 0.4);
}

.smart-play-btn:active {
	transform: translateY(0);
}

@media (max-width: 360px) {
	.smart-buttons-container {
		flex-wrap: wrap;
		gap: 6px;
	}

	.smart-play-btn {
		width: 100px;
		height: 48px;
		font-size: 10px;
	}
}

.as-meta-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 18px;
}

.as-meta-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 12px;
	background-color: rgba(255, 255, 255, 0.05);
	color: #94a3b8;
	font-size: 12px;
}

.as-meta-pill:hover {
	color: #ffffff;
}

.as-overview-card {
	background: rgba(17, 24, 39, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.03);
	border-radius: 16px;
	padding: 16px;
	margin-bottom: 22px;
}

.as-overview-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 18px;
	font-weight: 700;
	color: #cbd5e1;
	margin: 0 0 12px;
}

.as-overview-heading svg {
	color: var(--as-primary-light);
}

.as-overview-text {
	position: relative;
	color: #94a3b8;
	font-size: 14px;
	line-height: 1.5em;
	margin: 0;
	transition: max-height 0.3s ease;
}

.as-overview-text p {
	margin: 0 0 8px;
}

.as-overview-text.is-clamped {
	max-height: 4.5em;
	overflow: hidden;
}

.as-overview-fade {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 30px;
	background: linear-gradient(to top, rgba(17, 24, 39, 1), rgba(17, 24, 39, 0));
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 1;
}

.as-overview-toggle {
	display: block;
	margin: 6px auto 4px;
	padding: 0;
	background: none;
	border: none;
	color: #a855f7;
	font-size: 13px;
	font-weight: 500;
	text-align: center;
	width: 100%;
}

.as-tag-group {
	margin-top: 14px;
}

.as-tag-group-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #94a3b8;
	margin-bottom: 8px;
}

.as-pill-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.as-genre-pill {
	display: inline-flex;
	align-items: center;
	padding: 2px 6px;
	border-radius: 12px;
	background: rgba(147, 51, 234, 0.15);
	border: 1px solid rgba(147, 51, 234, 0.2);
	color: #a855f7;
	font-size: 10px;
	font-weight: 500;
}

.as-genre-pill:hover {
	background: rgba(147, 51, 234, 0.28);
	color: #e9d5ff;
}

.as-lang-pill {
	display: inline-flex;
	align-items: center;
	padding: 2px 6px;
	border-radius: 12px;
	background: rgba(236, 72, 153, 0.15);
	border: 1px solid rgba(236, 72, 153, 0.2);
	color: #ec4899;
	font-size: 10px;
	font-weight: 500;
}

.as-lang-pill:hover {
	background: rgba(236, 72, 153, 0.28);
	color: #fbcfe8;
}

/* Exact Season Tabs (.season-buttons-wrapper, .season-btn + ::before sheen + .scroll-arrow) */
.season-buttons-wrapper {
	width: 100%;
	overflow: hidden;
	position: relative;
	margin-bottom: 12px;
}

.season-buttons {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	margin: 10px 0;
	padding: 5px 0;
	scrollbar-width: none;
	width: 100%;
}

.season-buttons::-webkit-scrollbar {
	display: none;
}

.season-buttons-wrapper::after {
	content: "";
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 60px;
	background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.season-buttons-wrapper.has-overflow::after {
	opacity: 1;
}

.scroll-arrow {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-54%);
	background: linear-gradient(45deg, #ec4899, #a855f7, #ec4899, #a855f7);
	background-size: 300% 300%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	border: none;
	font-size: 36px;
	line-height: 1;
	opacity: 0;
	pointer-events: none;
	transition: all 0.3s ease;
	z-index: 10;
	animation: asGradientFlow 3s ease infinite;
}

.season-buttons-wrapper.has-overflow .scroll-arrow {
	opacity: 1;
	pointer-events: auto;
}

.season-btn {
	padding: 10px 16px;
	background: rgba(148, 163, 184, 0.1);
	color: #94a3b8;
	border: 1px solid rgba(148, 163, 184, 0.3);
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.3px;
	min-width: 120px;
	flex-shrink: 0;
	white-space: nowrap;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	position: relative;
	overflow: hidden;
}

.season-btn::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	transition: left 0.5s ease;
}

.season-btn:hover {
	color: #cbd5e1;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	border-color: rgba(148, 163, 184, 0.6);
	background: rgba(148, 163, 184, 0.15);
}

.season-btn:hover::before {
	left: 100%;
}

.season-btn.active {
	background: rgba(148, 163, 184, 0.25);
	color: #f1f5f9;
	border-color: rgba(148, 163, 184, 0.8);
	box-shadow: 0 0 8px rgba(148, 163, 184, 0.3);
}

.single-episode .season-btn {
	background: rgba(17, 24, 39, 0.4);
	color: #f8fafc;
	border-color: rgba(255, 255, 255, 0.15);
}

.single-episode .season-btn:hover {
	border-color: var(--as-primary);
}

.single-episode .season-btn.active {
	background: rgba(17, 24, 39, 0.6);
	border-color: var(--as-primary);
	box-shadow: 0 0 8px rgba(147, 51, 234, 0.4);
}

/* 16:9 Episode Grid Matching .rcl2 / .rcl3c / .rcl4d / .rcl8e */
.as-episode-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 30px;
}

@media (min-width: 1200px) {
	.as-episode-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1600px) {
	.as-episode-grid {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}
}

.as-episode-panel {
	display: none;
}

.as-episode-panel.active {
	display: block;
}

.as-ep-card {
	position: relative;
	display: block;
	overflow: hidden;
	transition: 0.2s;
}

.as-ep-thumb {
	position: relative;
	width: 100%;
	border-radius: 0.2rem;
	overflow: hidden;
	background: #161622;
}

.as-ep-thumb figure {
	position: relative;
	overflow: hidden;
}

.as-ep-thumb figure::before {
	content: "";
	padding-top: 56%;
	display: block;
}

.as-ep-thumb figure img {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	transition: all 0.4s ease-in-out;
}

.as-ep-card.is-current .as-ep-thumb {
	border: 2px solid var(--as-primary-light);
	box-shadow: 0 0 14px var(--as-primary-glow);
}

.as-ep-num {
	position: absolute;
	top: 0;
	left: 0;
	background-color: rgba(30, 35, 45, 0.75);
	color: var(--as-text);
	padding: 0 4px;
	border-bottom-right-radius: 5px;
	font-size: 1rem;
	line-height: 1.15rem;
	box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
	z-index: 3;
}

.as-ep-title {
	margin: 6px 0 0;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.2;
	color: var(--as-light);
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 575px) {
	.as-ep-title {
		font-size: 0.75rem;
	}
}

/* Watch Page Player & Exact Action Bar / Toggles / Server Grid */
.as-player-title-card {
	background: rgba(17, 24, 39, 0.42);
	border: 1px solid rgba(255, 255, 255, 0.03);
	border-radius: var(--as-radius);
	padding: 12px 16px;
	margin-bottom: 12px;
	box-shadow: var(--as-shadow);
}

.as-player-title-card h1 {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--as-light-text);
}

.as-player-sub {
	font-size: 12px;
	color: var(--as-text);
	margin-top: 2px;
}

.as-player-frame-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000000;
	border-radius: var(--as-radius);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.06);
	margin-bottom: 12px;
}

.as-player-frame-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.as-player-empty {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--as-text);
	text-align: center;
	padding: 24px;
}

.as-player-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgba(17, 24, 39, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.03);
	border-radius: var(--as-radius);
	padding: 10px 12px;
	margin-bottom: 12px;
	box-shadow: var(--as-shadow);
}

.as-player-bar-group {
	display: flex;
	align-items: center;
	gap: 16px;
}

.as-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	color: var(--as-text);
	background: transparent;
	transition: all 0.2s;
}

.as-icon-btn:hover {
	color: var(--as-light-text);
	background-color: rgba(255, 255, 255, 0.1);
}

.as-icon-btn.disabled {
	opacity: 0.5;
	pointer-events: none;
}

.as-toggles-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: rgba(17, 24, 39, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.03);
	border-radius: var(--as-radius);
	padding: 10px 12px;
	margin-bottom: 20px;
	box-shadow: var(--as-shadow);
}

.as-toggle-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8rem;
	color: var(--as-text);
	font-weight: 500;
	cursor: pointer;
}

.as-switch {
	position: relative;
	width: 40px;
	height: 20px;
	display: inline-block;
}

.as-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.as-switch-slider {
	position: absolute;
	inset: 0;
	background: #27273a;
	border-radius: 20px;
	transition: 0.4s;
}

.as-switch-slider::before {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	left: 2px;
	bottom: 2px;
	border-radius: 50%;
	background: #ffffff;
	transition: 0.4s;
	box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.as-switch input:checked + .as-switch-slider {
	background: var(--as-primary);
}

.as-switch input:checked + .as-switch-slider::before {
	transform: translateX(20px);
}

.as-servers-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin-bottom: 24px;
}

.as-server-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 10px;
	border-radius: var(--as-radius);
	background: rgba(17, 24, 39, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.03);
	color: var(--as-text);
	text-align: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: all 0.3s;
}

.as-server-card:hover {
	border-color: rgba(168, 85, 247, 0.45);
}

.as-server-card:active {
	transform: translateY(2px);
}

.as-server-card.active {
	background-color: rgba(17, 24, 39, 0.7);
	border-color: var(--as-primary-light);
	box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4);
}

.as-server-name {
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #f8fafc;
}

.as-server-card.active .as-server-name {
	color: var(--as-primary-light);
}

.as-server-label {
	font-size: 0.7rem;
	color: var(--as-text);
	opacity: 0.8;
}

@media (max-width: 767px) {
	.as-servers-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 6px;
	}

	.as-server-card {
		padding: 8px 4px;
	}

	.as-server-name {
		font-size: 0.7rem;
	}

	.as-server-label {
		font-size: 0.6rem;
	}
}

@media (max-width: 400px) {
	.as-servers-grid {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
	}

	.as-server-card {
		flex: 1 0 calc(50% - 4px);
		min-width: calc(50% - 4px);
	}
}

/* Download Modal (.mdl / .mdl-cn) */
.as-mdl {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1050;
	padding: 1.5rem;
	align-items: center;
	justify-content: center;
}

.as-mdl.is-open {
	display: flex;
}

.as-mdl-ovr {
	position: fixed;
	inset: 0;
	background: rgba(9, 9, 11, 0.82);
	backdrop-filter: blur(6px);
}

.as-mdl-cn {
	position: relative;
	z-index: 2;
	background: #141424;
	border: 1px solid rgba(168, 85, 247, 0.35);
	border-radius: 14px;
	max-width: 25rem;
	width: 100%;
	box-shadow: 0 0 2rem rgba(0, 0, 0, 0.65);
	overflow: hidden;
}

.as-mdl-hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.as-mdl-hd h3 {
	margin: 0;
	font-size: 16px;
	color: #ffffff;
}

.as-mdl-close-btn {
	background: none;
	border: none;
	color: var(--as-text);
	font-size: 22px;
	line-height: 1;
}

.as-mdl-bd {
	padding: 18px;
}

.as-mdl-sub {
	margin: 0 0 14px;
	font-size: 13px;
	color: #cbd5e1;
}

.as-mdl-dl-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 16px;
	border-radius: 10px;
	background: linear-gradient(135deg, #9333ea, #7c28cc);
	color: #ffffff;
	font-weight: 600;
	font-size: 13px;
}

.as-mdl-dl-btn:hover {
	filter: brightness(1.1);
}

/* Collapsible Comments */
.as-comments-box {
	margin-bottom: 30px;
}

.as-comments-trigger {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	border-radius: 12px;
	background: rgba(17, 24, 39, 0.42);
	border: 1px solid rgba(255, 255, 255, 0.06);
	color: var(--as-text);
	font-size: 13px;
	font-weight: 600;
}

.as-comments-trigger:hover {
	border-color: var(--as-primary-light);
	color: #ffffff;
}

.as-comments-form-wrap {
	margin-top: 12px;
	background: rgba(17, 24, 39, 0.42);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	padding: 16px;
}

.as-comments-box .comment-list {
	list-style: none;
	padding: 0;
	margin: 0 0 14px;
}

.as-comments-box .comment-body {
	padding: 12px 14px;
	background: #151521;
	border-radius: 10px;
	margin-bottom: 10px;
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.as-comments-box input[type="text"],
.as-comments-box input[type="email"],
.as-comments-box input[type="url"],
.as-comments-box textarea {
	width: 100%;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid var(--as-border);
	background: #14141e;
	color: #ffffff;
	font-family: inherit;
}

.as-comments-box .submit {
	padding: 10px 20px;
	border-radius: 8px;
	border: none;
	background: var(--as-primary);
	color: #ffffff;
	font-weight: 600;
	cursor: pointer;
}

.as-empty-state {
	padding: 40px 20px;
	text-align: center;
	background: #101018;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 14px;
	color: var(--as-text);
}
