/*
Theme Name: Newsmag PhePhimHD - Rap Phim v5 Edition
Theme URI: https://phephimhd.org
Description: Giao diện Rạp Phim v5 phong cách Cool Brutalist Cinema độc quyền cho PhePhimHD.org. Nền xám ghi mát lạnh (#EEF0F3), điểm nhấn Xanh Cobalt (#2A44E0), font Archivo 125% siêu mạnh mẽ và IBM Plex Mono công nghệ cao.
Author: Team Antigravity
Version: 5.0.0
Text Domain: phephimhd
*/

:root {
	--r5-bg: #EEF0F3;
	--r5-surface: #FFFFFF;
	--r5-ink: #0E1220;
	--r5-ink-2: #353B4A;
	--r5-muted: #5F6677;
	--r5-accent: #2A44E0;
	--r5-accent-hover: #1F35B8;
	--r5-accent-light: #7B8FFF;
	--r5-player: #0B0E18;
	--r5-up: #1C8454;
	--r5-down: #D0343F;
	--r5-line: rgba(14, 18, 32, 0.10);
	--r5-line-strong: rgba(14, 18, 32, 0.18);
	--r5-font-main: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--r5-font-mono: 'IBM Plex Mono', monospace, ui-monospace;
}

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

html {
	font-size: 16px;
	scroll-behavior: smooth;
	-webkit-tap-highlight-color: transparent;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--r5-bg);
	color: var(--r5-ink);
	font-family: var(--r5-font-main);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

a {
	color: var(--r5-ink);
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover {
	color: var(--r5-accent);
}

button, input, select, textarea {
	font-family: inherit;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
	height: 6px;
	width: 6px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: #C3C8D3;
	border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
	background: #9DA6B8;
}

/* ==========================================================================
   TYPOGRAPHY HELPERS (ARCHIVO 125% & IBM PLEX MONO)
   ========================================================================== */
.r5-title-giant {
	font-family: var(--r5-font-main);
	
	font-weight: 900;
	text-transform: uppercase;
	line-height: 0.92;
	letter-spacing: -0.025em;
}

.r5-section-title {
	font-family: var(--r5-font-main);
	
	font-weight: 900;
	font-size: clamp(22px, 2.6vw, 30px);
	text-transform: uppercase;
	letter-spacing: -0.01em;
	margin: 0;
}

.r5-mono {
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ==========================================================================
   HEADER (2-TIER STICKY)
   ========================================================================== */
.r5-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(238, 240, 243, 0.90);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--r5-line);
	transition: box-shadow 0.25s ease;
}

.r5-header-t1 {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 64px;
	padding: 0 clamp(16px, 3vw, 40px);
}

@media (max-width: 639px) {
	.r5-header-t1 {
		height: 56px;
		padding: 0 16px;
		gap: 12px;
	}
	.r5-desktop-only {
		display: none !important;
	}
}

.r5-btn-menu-mobile {
	display: none;
	width: 44px;
	height: 44px;
	place-items: center;
	border-radius: 8px;
	border: 1px solid var(--r5-line-strong);
	background: transparent;
	color: var(--r5-ink);
	cursor: pointer;
}

@media (max-width: 639px) {
	.r5-btn-menu-mobile {
		display: grid;
	}
}

.r5-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: var(--r5-ink);
}

.r5-brand-box {
	width: 14px;
	height: 14px;
	border-radius: 4px;
	background: var(--r5-accent);
	box-shadow: 0 2px 8px rgba(42, 68, 224, 0.35);
}

.r5-brand-text {
	
	font-weight: 900;
	font-size: 24px;
	letter-spacing: -0.02em;
	color: var(--r5-ink);
	line-height: 1;
}

.r5-brand-sub {
	font-family: var(--r5-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--r5-muted);
	padding-top: 4px;
}

.r5-nav-top-links {
	display: flex;
	gap: 22px;
	margin-left: 12px;
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
}

@media (max-width: 1099px) {
	.r5-nav-top-links {
		display: none;
	}
}

.r5-nav-top-links a {
	color: var(--r5-ink-2);
	transition: color 0.15s ease;
}

.r5-nav-top-links a:hover {
	color: var(--r5-accent);
}

.r5-search-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	width: clamp(200px, 30vw, 380px);
	height: 44px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid rgba(14, 18, 32, 0.12);
	background: var(--r5-surface);
	color: var(--r5-muted);
	position: relative;
}

@media (max-width: 639px) {
	.r5-search-wrap {
		display: none;
	}
}

.r5-search-wrap input {
	flex: 1;
	min-width: 0;
	background: none;
	border: 0;
	outline: 0;
	color: var(--r5-ink);
	font-size: 14px;
}

.r5-search-dropdown {
	position: absolute;
	top: 50px;
	left: 0;
	right: 0;
	background: var(--r5-surface);
	border: 1px solid var(--r5-line-strong);
	border-radius: 12px;
	box-shadow: 0 16px 36px rgba(14, 18, 32, 0.16);
	max-height: 420px;
	overflow-y: auto;
	z-index: 100;
	display: none;
}

.r5-search-dropdown.is-open {
	display: block;
}

.r5-btn-app-header {
	height: 44px;
	padding: 0 18px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: 8px;
	background: var(--r5-accent);
	color: #FFFFFF;
	
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(42, 68, 224, 0.25);
	transition: background 0.15s ease, transform 0.12s ease;
}

.r5-btn-app-header:hover {
	background: var(--r5-accent-hover);
	color: #FFFFFF;
	transform: translateY(-1px);
}

@media (max-width: 639px) {
	.r5-btn-app-header {
		padding: 0 12px;
		height: 38px;
		font-size: 13px;
	}
	.r5-btn-app-header span {
		display: none;
	}
}

.r5-avatar {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--r5-ink);
	color: #FFFFFF;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 800;
	
}

/* Header Tier 2 (Category Pills) */
.r5-header-t2 {
	display: flex;
	gap: 6px;
	align-items: center;
	height: 56px;
	padding: 0 clamp(16px, 3vw, 40px);
	overflow-x: auto;
	scrollbar-width: none;
	border-top: 1px solid var(--r5-line);
}

.r5-header-t2::-webkit-scrollbar {
	display: none;
}

.r5-tab-pill {
	flex: none;
	height: 40px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--r5-ink);
	
	font-weight: 700;
	font-size: 13.5px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
	display: inline-flex;
	align-items: center;
}

.r5-tab-pill:hover {
	background: var(--r5-surface);
	color: var(--r5-ink);
}

.r5-tab-pill.is-active {
	background: var(--r5-ink);
	color: #FFFFFF;
}

/* ==========================================================================
   HOMEPAGE LAYOUT & SECTIONS
   ========================================================================== */
.r5-home-main {
	display: flex;
	flex-direction: column;
	gap: clamp(48px, 6vw, 80px);
	padding: clamp(24px, 3.6vw, 48px) clamp(16px, 3vw, 40px);
	max-width: 1440px;
	margin: 0 auto;
	width: 100%;
}

@media (max-width: 639px) {
	.r5-home-main {
		padding: 20px 16px;
		gap: 40px;
	}
}

/* 1. HERO TÂM ĐIỂM */
.r5-hero-lead {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: clamp(20px, 3vw, 40px);
	align-items: stretch;
}

@media (max-width: 1099px) {
	.r5-hero-lead {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

.r5-lead-media-wrap {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	aspect-ratio: 4 / 3;
	background: var(--r5-player);
	cursor: pointer;
	transition: filter 0.3s ease;
}

@media (max-width: 1099px) and (min-width: 640px) {
	.r5-lead-media-wrap {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 639px) {
	.r5-lead-media-wrap {
		aspect-ratio: 4 / 3;
		border-radius: 0;
		margin: 0 -16px;
	}
}

.r5-lead-media-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.r5-lead-media-wrap:hover {
	filter: brightness(1.07);
}

.r5-lead-badge {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 40px;
	display: flex;
	align-items: center;
	padding: 0 16px;
	background: var(--r5-accent);
	color: #FFFFFF;
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.r5-lead-info {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 20px;
	min-width: 0;
}

.r5-lead-eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--r5-muted);
}

.r5-lead-eyebrow span.accent {
	color: var(--r5-accent);
}

.r5-lead-title {
	margin: 0;
	font-weight: 800;
	font-size: clamp(22px, 2.5vw, 36px);
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--r5-ink);
	word-break: break-word;
	overflow-wrap: break-word;
}
@media (max-width: 768px) {
	.r5-lead-title {
		font-size: 20px;
		line-height: 1.25;
	}
}
@media (max-width: 480px) {
	.r5-lead-title {
		font-size: 18px;
		line-height: 1.28;
	}
}

.r5-lead-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-family: var(--r5-font-mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--r5-ink-2);
}

.r5-lead-desc {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: var(--r5-ink-2);
	max-width: 52ch;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.r5-lead-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.r5-chip {
	height: 30px;
	display: inline-flex;
	align-items: center;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid rgba(14, 18, 32, 0.2);
	font-size: 13px;
	font-weight: 600;
	color: var(--r5-ink);
}

.r5-lead-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.r5-btn-primary {
	border-radius: 8px;
	height: 52px;
	padding: 0 24px;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	border: 0;
	background: var(--r5-accent);
	color: #FFFFFF;
	
	font-weight: 800;
	font-size: 15px;
	letter-spacing: 0.03em;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(42, 68, 224, 0.28);
	transition: background 0.15s ease, transform 0.12s ease;
}

.r5-btn-primary:hover {
	background: var(--r5-accent-hover);
	color: #FFFFFF;
	transform: translateY(-1px);
}

.r5-btn-secondary {
	border-radius: 8px;
	height: 52px;
	padding: 0 20px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 1px solid var(--r5-line-strong);
	background: transparent;
	color: var(--r5-ink);
	
	font-weight: 800;
	font-size: 15px;
	letter-spacing: 0.03em;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.r5-btn-secondary:hover {
	background: var(--r5-ink);
	color: #FFFFFF;
}

/* 3 Sub-Features Row */
.r5-subs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 12px;
	margin-top: 14px;
}

@media (max-width: 639px) {
	.r5-subs-grid {
		grid-template-columns: 1fr;
	}
}

.r5-sub-card {
	display: flex;
	gap: 14px;
	padding: 14px 12px;
	border-radius: 14px;
	cursor: pointer;
	min-width: 0;
	background: transparent;
	transition: background-color 0.2s ease;
}

.r5-sub-card:hover {
	background: var(--r5-surface);
}

.r5-sub-thumb {
	flex: none;
	width: 120px;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	overflow: hidden;
	background: var(--r5-player);
}

.r5-sub-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.r5-sub-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.r5-sub-num {
	font-family: var(--r5-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--r5-accent);
}

.r5-sub-title {
	font-stretch: 118%;
	font-weight: 800;
	font-size: 18px;
	line-height: 1.15;
	text-transform: uppercase;
	color: var(--r5-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.r5-sub-desc {
	font-size: 13px;
	color: var(--r5-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 2. XEM TIẾP (CONTINUE WATCHING) */
.r5-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 2px solid var(--r5-ink);
	padding-bottom: 12px;
}

.r5-continue-scroll {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.r5-continue-scroll::-webkit-scrollbar {
	display: none;
}

.r5-continue-card {
	flex: none;
	width: 300px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	cursor: pointer;
}

@media (max-width: 639px) {
	.r5-continue-card {
		width: 240px;
	}
}

.r5-continue-thumb-wrap {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 16 / 9;
	background: var(--r5-player);
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease;
}

.r5-continue-thumb-wrap:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(14, 18, 32, 0.18);
}

.r5-continue-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.r5-continue-play-circle {
	position: absolute;
	left: 12px;
	top: 12px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #FFFFFF;
	display: grid;
	place-items: center;
	color: var(--r5-ink);
}

.r5-continue-progress-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 5px;
	background: rgba(255, 255, 255, 0.35);
}

.r5-continue-progress-fill {
	height: 100%;
	background: var(--r5-accent);
}

/* 3. BẢNG XẾP HẠNG (CHART TABLE) */
.r5-chart-table {
	display: flex;
	flex-direction: column;
}

.r5-chart-header-row {
	display: grid;
	grid-template-columns: 48px 44px 2fr 1.2fr 0.8fr 72px 88px;
	gap: 16px;
	align-items: center;
	padding: 10px 8px;
	border-bottom: 1px solid rgba(14, 18, 32, 0.16);
	font-family: var(--r5-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--r5-muted);
}

@media (max-width: 1099px) {
	.r5-chart-header-row {
		display: none;
	}
}

.r5-chart-row {
	display: grid;
	grid-template-columns: 48px 44px 2fr 1.2fr 0.8fr 72px 88px;
	gap: 16px;
	align-items: center;
	padding: 12px 8px;
	border-bottom: 1px solid var(--r5-line);
	border-radius: 10px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

@media (max-width: 1099px) {
	.r5-chart-row {
		grid-template-columns: 40px 44px 1fr auto;
		gap: 12px;
	}
}

.r5-chart-row:hover {
	background: var(--r5-surface);
}

.r5-chart-rank {
	
	font-weight: 900;
	font-size: 28px;
	line-height: 1;
	color: var(--r5-ink);
	text-align: center;
}

.r5-chart-rank.is-top3 {
	color: var(--r5-accent);
}

.r5-chart-poster {
	width: 44px;
	aspect-ratio: 2 / 3;
	border-radius: 6px;
	overflow: hidden;
	background: var(--r5-player);
}

.r5-chart-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.r5-chart-trend {
	font-family: var(--r5-font-mono);
	font-size: 13px;
	font-weight: 600;
	text-align: right;
}

.r5-chart-trend.is-up {
	color: var(--r5-up);
}

.r5-chart-trend.is-down {
	color: var(--r5-down);
}

.r5-chart-trend.is-same {
	color: var(--r5-muted);
}

/* 4. DANH MỤC 3 CỘT (CATEGORY INDEX) */
.r5-cat-index-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 12px clamp(20px, 3vw, 40px);
}

@media (max-width: 639px) {
	.r5-cat-index-grid {
		grid-template-columns: 1fr;
	}
}

.r5-cat-item-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 52px;
	border-top: 1px solid var(--r5-line);
	cursor: pointer;
	transition: color 0.2s ease, padding-left 0.25s ease;
}

.r5-cat-item-row:hover {
	color: var(--r5-accent);
	padding-left: 6px;
}

/* 5. LƯỚI PHIM (POSTER GRID) */
.r5-sort-group {
	display: flex;
	gap: 2px;
	padding: 3px;
	border-radius: 10px;
	background: var(--r5-surface);
	border: 1px solid rgba(14, 18, 32, 0.12);
}

.r5-sort-btn {
	border-radius: 8px;
	height: 36px;
	padding: 0 14px;
	border: 0;
	background: transparent;
	color: var(--r5-muted);
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: all 0.15s ease;
}

.r5-sort-btn.is-active {
	background: var(--r5-ink);
	color: #FFFFFF;
}

.r5-poster-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 28px clamp(12px, 1.6vw, 20px);
}

@media (max-width: 1099px) {
	.r5-poster-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	}
}

@media (max-width: 639px) {
	.r5-poster-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 18px 12px;
	}
}

.r5-poster-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	cursor: pointer;
	min-width: 0;
}

.r5-poster-wrap {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 2 / 3;
	background: var(--r5-player);
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease;
}

.r5-poster-card:hover .r5-poster-wrap {
	transform: translateY(-6px);
	box-shadow: 0 18px 36px rgba(14, 18, 32, 0.20);
}

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

.r5-badge-left {
	position: absolute;
	left: 8px;
	top: 8px;
	border-radius: 6px;
	height: 24px;
	display: flex;
	align-items: center;
	padding: 0 8px;
	background: #FFFFFF;
	font-family: var(--r5-font-mono);
	font-size: 11px;
	font-weight: 600;
	color: var(--r5-ink);
}

.r5-badge-right {
	position: absolute;
	right: 8px;
	top: 8px;
	border-radius: 6px;
	height: 24px;
	display: flex;
	align-items: center;
	padding: 0 8px;
	background: var(--r5-ink);
	color: #FFFFFF;
	font-family: var(--r5-font-mono);
	font-size: 11px;
	font-weight: 600;
}

.r5-poster-title-overlay {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	font-stretch: 118%;
	font-weight: 900;
	font-size: 17px;
	line-height: 1.1;
	text-transform: uppercase;
	color: #FFFFFF;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ==========================================================================
   WATCH PAGE (TRANG XEM PHIM)
   ========================================================================== */
.r5-watch-main {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.r5-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 14px clamp(16px, 3vw, 40px);
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--r5-muted);
}

@media (max-width: 639px) {
	.r5-breadcrumb {
		display: none;
	}
}

.r5-player-stage {
	width: 100%;
	background: var(--r5-player);
	padding: 0;
}

@media (min-width: 640px) {
	.r5-player-stage {
		padding: 20px clamp(16px, 3vw, 40px);
		background: transparent;
	}
}

@media (max-width: 639px) {
	.r5-player-stage.is-sticky {
		position: sticky;
		top: 56px;
		z-index: 40;
	}
}

.r5-player-viewport {
	max-width: 1400px;
	margin: 0 auto;
	position: relative;
	aspect-ratio: 16 / 9;
	max-height: 76vh;
	width: 100%;
	background: var(--r5-player);
	overflow: hidden;
	border-radius: 16px;
	box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
}

@media (max-width: 639px) {
	.r5-player-viewport {
		border-radius: 0;
		box-shadow: none;
	}
}

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

/* EPISODE RAIL */
.r5-rail-section {
	max-width: 1400px;
	margin: 0 auto;
	width: 100%;
	padding: 20px clamp(16px, 3vw, 40px) 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.r5-rail-wrap {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-snap-type: x proximity;
	padding: 6px 0;
}

.r5-rail-wrap::-webkit-scrollbar {
	display: none;
}

.r5-rail-item {
	flex: none;
	width: 156px;
	padding: 12px;
	border-radius: 12px;
	background: var(--r5-surface);
	border: 1px solid var(--r5-line);
	cursor: pointer;
	scroll-snap-align: center;
	display: flex;
	flex-direction: column;
	gap: 6px;
	transition: all 0.15s ease;
}

@media (max-width: 639px) {
	.r5-rail-item {
		width: 132px;
		padding: 10px;
	}
}

.r5-rail-item:hover {
	border-color: var(--r5-accent);
}

.r5-rail-item.is-active {
	background: var(--r5-accent);
	border-color: var(--r5-accent);
	color: #FFFFFF;
}

.r5-rail-item.is-active .r5-mono {
	color: #FFFFFF !important;
}

.r5-rail-ep-num {
	
	font-weight: 900;
	font-size: 26px;
	line-height: 1;
}

/* WATCH CONTENT GRID */
.r5-watch-grid {
	max-width: 1400px;
	margin: 0 auto;
	width: 100%;
	padding: 24px clamp(16px, 3vw, 40px) 60px;
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: clamp(24px, 3.4vw, 48px);
	align-items: start;
}

@media (max-width: 1099px) {
	.r5-watch-grid {
		grid-template-columns: 1fr;
		padding: 20px 16px 60px;
	}
}

.r5-watch-col-left {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.r5-watch-title {
	margin: 0;
	font-weight: 800;
	font-size: clamp(21px, 2.3vw, 32px);
	line-height: 1.22;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--r5-ink);
	word-break: break-word;
	overflow-wrap: break-word;
}
@media (max-width: 768px) {
	.r5-watch-title {
		font-size: 19px;
		line-height: 1.25;
	}
}
@media (max-width: 480px) {
	.r5-watch-title {
		font-size: 17px;
		line-height: 1.28;
	}
}

.r5-watch-title em {
	font-style: normal;
	color: var(--r5-accent);
}

/* Action buttons */
.r5-watch-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.r5-watch-act-btn {
	height: 44px;
	padding: 0 18px;
	border-radius: 8px;
	border: 1px solid var(--r5-line-strong);
	background: var(--r5-surface);
	color: var(--r5-ink);
	font-family: var(--r5-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.r5-watch-act-btn:hover {
	background: var(--r5-bg);
}

.r5-watch-act-btn.is-liked {
	background: var(--r5-accent);
	border-color: var(--r5-accent);
	color: #FFFFFF;
}

.r5-watch-act-btn.is-saved {
	background: var(--r5-ink);
	border-color: var(--r5-ink);
	color: #FFFFFF;
}

/* Aside Up Next */
.r5-watch-aside {
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-width: 0;
}

.r5-next-card {
	padding: 16px;
	border-radius: 16px;
	background: var(--r5-surface);
	border: 1px solid var(--r5-line);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ==========================================================================
   FOOTER & MOBILE TAB BAR
   ========================================================================= */
.r5-footer {
	margin-top: 60px;
	padding: 48px clamp(16px, 3vw, 40px);
	border-top: 2px solid var(--r5-ink);
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.r5-footer-wordmark {
	display: flex;
	align-items: baseline;
	gap: 12px;
	
	font-weight: 900;
	font-size: clamp(64px, 13vw, 180px);
	line-height: 0.85;
	letter-spacing: -0.04em;
	color: var(--r5-ink);
	text-transform: uppercase;
}

.r5-footer-dot {
	width: clamp(16px, 3vw, 36px);
	height: clamp(16px, 3vw, 36px);
	border-radius: 6px;
	background: var(--r5-accent);
	display: inline-block;
}

.r5-mobile-bottom-nav {
	display: none;
}

@media (max-width: 639px) {
	.r5-mobile-bottom-nav {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(10px + env(safe-area-inset-bottom, 10px));
		z-index: 45;
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		padding: 6px;
		border-radius: 20px;
		background: rgba(255, 255, 255, 0.95);
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
		border: 1px solid var(--r5-line);
		box-shadow: 0 10px 30px rgba(14, 18, 32, 0.16);
	}

	.r5-mob-tab {
		height: 52px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		border: 0;
		border-radius: 14px;
		background: transparent;
		color: var(--r5-muted);
		font-size: 11px;
		font-weight: 700;
		cursor: pointer;
		transition: all 0.15s ease;
	}

	.r5-mob-tab.is-active {
		background: #E3E8FF;
		color: var(--r5-accent);
	}

	body {
		padding-bottom: calc(76px + env(safe-area-inset-bottom, 10px));
	}
}

/* ==========================================================================
   BRAND LOGO STYLES (PHEPHIMHD)
   ========================================================================== */
.r5-brand {
	display: flex;
	align-items: center;
	text-decoration: none;
	cursor: pointer;
}
.r5-brand-logo-img {
	display: block;
	height: 42px;
	width: auto;
	max-width: 330px;
	object-fit: contain;
	filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.25));
	transition: transform 0.2s ease, filter 0.2s ease;
}
.r5-brand:hover .r5-brand-logo-img {
	transform: scale(1.03);
	filter: drop-shadow(0 4px 14px rgba(168, 85, 247, 0.45));
}
@media (max-width: 639px) {
	.r5-brand-logo-img {
		height: 32px;
		max-width: 220px;
	}
}
.r5-footer-brand {
	display: inline-block;
	text-decoration: none;
}
.r5-footer-logo-img {
	display: block;
	height: 38px;
	width: auto;
	max-width: 300px;
	object-fit: contain;
	filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.2));
}

/* === MOBILE UI OPTIMIZATION PATCH (375px HEADER FIT) === */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}
@media (max-width: 767px) {
    .r5-avatar {
        display: none !important;
    }
    .r5-logo img, .r5-brand img {
        max-width: 165px !important;
        height: auto !important;
    }
    .r5-header-t1 {
        gap: 8px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}
