:root {
	--bg: #0a0a0a;
	--bg-2: #141414;
	--bg-3: #1a1a1a;
	--maroon: #8B1538;
	--maroon-dark: #5c0d24;
	--maroon-bar: #6B0F1A;
	--maroon-glow: rgba(139, 21, 56, 0.55);
	--text: #ffffff;
	--muted: #a3a3a3;
	--gold: #f5c518;
	--border: rgba(255, 255, 255, 0.08);
	--radius: 10px;
	--radius-pill: 50px;
	--font: "Inter", system-ui, sans-serif;
	--bottom: 64px;
	--topbar: 56px;
	--catnav: 44px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--max-w: 480px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font);
	color: var(--text);
	background: var(--bg);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.app {
	position: relative;
	max-width: var(--max-w);
	min-height: 100vh;
	margin: 0 auto;
	padding-bottom: calc(var(--bottom) + env(safe-area-inset-bottom, 0px));
	background: var(--bg);
}

@media (min-width: 520px) {
	.app {
		margin-top: 8px;
		margin-bottom: 8px;
		min-height: calc(100vh - 16px);
		border: 1px solid var(--border);
		border-radius: 20px;
		overflow: hidden;
		box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
	}
}

/* Top bar */
.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: var(--topbar);
	padding: 0 16px;
	background: rgba(10, 10, 10, 0.92);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}

.logo {
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	text-transform: lowercase;
	color: var(--text);
}

.search-pill {
	flex: 1;
	max-width: 200px;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 14px;
	border-radius: var(--radius-pill);
	background: var(--bg-3);
	border: 1px solid var(--border);
	color: var(--muted);
}

.search-pill input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 0.82rem;
	outline: none;
}

.search-pill input::placeholder { color: var(--muted); }

/* Category nav */
.cat-nav {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	padding: 8px 16px 10px;
	scrollbar-width: none;
	border-bottom: 1px solid var(--border);
	background: var(--bg);
}

.cat-nav::-webkit-scrollbar { display: none; }

.cat-link {
	flex-shrink: 0;
	padding: 6px 14px;
	border-radius: var(--radius-pill);
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--muted);
	transition: color 0.2s, background 0.2s;
}

.cat-link.on {
	color: var(--text);
	background: var(--maroon);
}

.cat-link:hover:not(.on) { color: var(--text); }

/* Main */
.main {
	padding: 16px 16px 24px;
}

.main--watch {
	padding: 0;
}

.main--welcome {
	padding: 0;
	min-height: 100vh;
}

/* Sections */
.section { margin-bottom: 28px; }

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

.section-head h2 {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.section-head a {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--muted);
}

.section-head a:hover { color: var(--text); }

/* Trending carousel */
.trending-rail {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 6px;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	margin: 0 -16px;
	padding-left: 16px;
	padding-right: 16px;
}

.trending-rail::-webkit-scrollbar { display: none; }

.trend-card {
	position: relative;
	flex: 0 0 78%;
	scroll-snap-align: center;
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 16/10;
	background: var(--bg-2);
	transition: transform 0.3s var(--ease);
}

.trend-card.featured { flex: 0 0 85%; }

.trend-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.trend-mask {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(10, 10, 10, 0.95) 0%, rgba(139, 21, 56, 0.35) 45%, transparent 100%);
}

.trend-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 14px;
}

.trend-body h3 {
	margin: 0 0 4px;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
}

/* Poster rail */
.poster-rail {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 6px;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.poster-rail::-webkit-scrollbar { display: none; }

.poster-rail--wrap {
	flex-wrap: wrap;
	overflow-x: visible;
}

.poster-rail--wrap .media-poster {
	flex: 0 0 calc(33.333% - 8px);
}

.media-poster {
	flex: 0 0 108px;
	scroll-snap-align: start;
}

.media-poster-frame {
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 2/3;
	margin-bottom: 8px;
	background: var(--bg-2);
	transition: transform 0.25s;
}

.media-poster:hover .media-poster-frame { transform: scale(1.03); }

.media-poster-frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.media-poster h4 {
	margin: 0 0 4px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.star-rating {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--gold);
}

/* Detail / watch */
.app--watch .topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
	border: 0;
}

.detail-hero {
	position: relative;
	height: 52vh;
	min-height: 280px;
	max-height: 420px;
	background-size: cover;
	background-position: center top;
}

.detail-hero-mask {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(10, 10, 10, 0.15) 0%,
		rgba(139, 21, 56, 0.45) 55%,
		var(--bg) 100%
	);
}

.detail-body {
	position: relative;
	margin-top: -40px;
	padding: 0 16px 24px;
	z-index: 2;
}

.detail-actions-top { margin-bottom: 16px; }

.btn-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 140px;
	padding: 12px 28px;
	border-radius: var(--radius-pill);
	border: 0;
	background: #ffffff;
	color: var(--maroon);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s;
}

.btn-play:hover { transform: scale(1.02); }
.btn-play:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.detail-title {
	margin: 0 0 10px;
	font-size: 1.65rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.detail-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	font-size: 0.82rem;
}

.detail-genres { color: var(--muted); }

.detail-desc {
	margin: 0 0 20px;
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--muted);
}

.detail-tools {
	display: flex;
	gap: 20px;
	margin-bottom: 16px;
}

.tool-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text);
	font-size: 0.68rem;
	font-weight: 500;
	opacity: 0.85;
	transition: opacity 0.2s;
}

.tool-btn:hover { opacity: 1; }

.detail-bill {
	margin: 0;
	font-size: 0.75rem;
	color: var(--muted);
}

.detail-plans {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
}

.detail-plans h3 {
	margin: 0 0 12px;
	font-size: 0.9rem;
}

.plan-row {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
	font-size: 0.85rem;
}

/* Welcome / splash */
.welcome {
	position: relative;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
	overflow: hidden;
}

.welcome-grid {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(4, 1fr);
	gap: 4px;
	opacity: 0.45;
}

.welcome-grid img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.welcome-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(10, 10, 10, 0.3) 0%,
		rgba(139, 21, 56, 0.65) 50%,
		var(--bg) 85%
	);
}

.welcome-content {
	position: relative;
	z-index: 2;
	text-align: center;
}

.welcome-logo {
	margin: 0 0 12px;
	font-size: 3rem;
	font-weight: 800;
	letter-spacing: -0.04em;
	text-transform: lowercase;
}

.welcome-tagline {
	margin: 0 0 6px;
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.35;
}

.welcome-sub {
	margin: 0 0 28px;
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.75);
}

.welcome-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.btn-subscribe {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 24px;
	border-radius: var(--radius-pill);
	border: 0;
	background: #ffffff;
	color: var(--maroon);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
}

.btn-signin {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 24px;
	border-radius: var(--radius-pill);
	border: 1.5px solid rgba(255, 255, 255, 0.5);
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
}

.welcome-terms {
	margin: 0;
	font-size: 0.72rem;
	color: var(--muted);
}

.welcome-terms a { text-decoration: underline; }

/* Explore */
.page-title { margin-bottom: 20px; }
.page-title h1 { margin: 0 0 4px; font-size: 1.4rem; font-weight: 700; }
.page-title p { margin: 0; font-size: 0.85rem; color: var(--muted); }
.back { display: inline-block; margin-bottom: 8px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.explore-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.explore-tile {
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	min-height: 130px;
	border: 1px solid var(--border);
}

.explore-tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.5;
}

.explore-tile-mask {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(10, 10, 10, 0.95), rgba(139, 21, 56, 0.25));
}

.explore-tile-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 12px;
}

.explore-tile h3 {
	margin: 0 0 2px;
	font-size: 0.9rem;
	font-weight: 700;
}

.explore-tile span { font-size: 0.7rem; color: var(--muted); }

/* Live grid */
.live-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.live-card {
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 16/10;
	border: 1px solid var(--border);
}

.live-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.live-card-mask {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 60%);
}

.live-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 0.6rem;
	font-weight: 800;
	background: var(--maroon);
	color: white;
}

.live-card-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px;
}

.live-card h4 {
	margin: 0 0 2px;
	font-size: 0.78rem;
	font-weight: 600;
}

/* List */
.list-stack { display: flex; flex-direction: column; gap: 10px; }

.media-list {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: var(--radius);
	background: var(--bg-2);
	border: 1px solid var(--border);
}

.media-list-thumb {
	flex-shrink: 0;
	width: 72px;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 16/10;
	background: var(--bg-3);
}

.media-list-thumb img { width: 100%; height: 100%; object-fit: cover; }

.media-list-body { flex: 1; min-width: 0; }
.media-list-body h4 { margin: 0 0 4px; font-size: 0.88rem; font-weight: 600; }
.media-list-body p {
	margin: 0 0 4px;
	font-size: 0.75rem;
	color: var(--muted);
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.media-list-play {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--maroon);
	font-size: 0.7rem;
	flex-shrink: 0;
}

/* Account / plans */
.account-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px;
	border-radius: var(--radius);
	background: var(--bg-2);
	border: 1px solid var(--border);
	margin-bottom: 20px;
}

.account-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--maroon);
	font-weight: 800;
}

.account-card strong { display: block; margin-bottom: 2px; }
.account-card p { margin: 0; font-size: 0.82rem; color: var(--muted); }

.plan-cards { display: flex; flex-direction: column; gap: 12px; }

.plan-card {
	position: relative;
	padding: 20px;
	border-radius: var(--radius);
	background: var(--bg-2);
	border: 1px solid var(--border);
}

.plan-card.best {
	border-color: var(--maroon);
	background: linear-gradient(135deg, rgba(139, 21, 56, 0.25), var(--bg-2));
}

.plan-card h3 { margin: 8px 0 4px; font-size: 1.05rem; }

.plan-price {
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--text);
	margin-bottom: 6px;
}

.plan-card p {
	margin: 0 0 14px;
	font-size: 0.82rem;
	color: var(--muted);
}

.plan-card small {
	display: block;
	margin-top: 10px;
	font-size: 0.72rem;
	color: var(--muted);
	text-align: center;
}

.pill {
	display: inline-block;
	padding: 4px 10px;
	border-radius: var(--radius-pill);
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	background: var(--maroon);
}

.search-page {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

.search-page input {
	flex: 1;
	padding: 12px 16px;
	border-radius: var(--radius-pill);
	border: 1px solid var(--border);
	background: var(--bg-2);
	color: var(--text);
	font: inherit;
	outline: none;
}

.btn-maroon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border-radius: var(--radius-pill);
	border: 0;
	background: var(--maroon);
	color: white;
	font: inherit;
	font-weight: 600;
	font-size: 0.88rem;
}

.btn-block { width: 100%; }

.results-hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }

.empty {
	padding: 48px 20px;
	text-align: center;
	color: var(--muted);
}

.empty h2 { color: var(--text); margin-bottom: 8px; }

.sub-badge {
	position: fixed;
	left: 50%;
	bottom: calc(var(--bottom) + 8px);
	transform: translateX(-50%);
	padding: 4px 12px;
	border-radius: var(--radius-pill);
	font-size: 0.62rem;
	font-weight: 600;
	background: var(--maroon);
	color: white;
	z-index: 99;
	pointer-events: none;
}

[data-reveal] {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

[data-reveal].visible { opacity: 1; transform: none; }

/* Bottom bar */
.bottombar {
	position: fixed;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: min(var(--max-w), 100%);
	height: var(--bottom);
	display: flex;
	align-items: stretch;
	padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
	background: var(--maroon-bar);
	z-index: 100;
}

@media (min-width: 520px) {
	.bottombar {
		border-radius: 0 0 20px 20px;
	}
}

.bottom-link {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	font-size: 0.58rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.55);
	transition: color 0.2s;
}

.bottom-link.on { color: #ffffff; }
.bottom-link svg { opacity: 0.9; }
.bottom-link.on svg { opacity: 1; }
