/* =========================================================================
   PlayHub — design tokens
   ========================================================================= */
:root {
	--ph-accent: #ff5c3e;
	--ph-accent-ink: #ffffff;

	--ph-bg: #f6f7f8;
	--ph-surface: #ffffff;
	--ph-surface-2: #eef0f2;
	--ph-border: #e2e5e9;
	--ph-text: #0f1114;
	--ph-text-muted: #5b6169;
	--ph-text-faint: #8a909a;
	--ph-overlay: rgba(15, 17, 20, 0.65);
	--ph-skeleton: #e9ebee;
	--ph-skeleton-shine: #f7f8f9;

	--ph-radius-sm: 8px;
	--ph-radius-md: 12px;
	--ph-radius-lg: 16px;
	--ph-shadow-sm: 0 1px 2px rgba(15, 17, 20, 0.06);
	--ph-shadow-md: 0 8px 24px rgba(15, 17, 20, 0.10);

	--ph-header-h: 64px;
	--ph-sidebar-w: 240px;
	--ph-sidebar-w-collapsed: 76px;

	--ph-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;

	color-scheme: light;
}

:root[data-color-mode="dark"],
body[data-color-mode="dark"] {
	color-scheme: dark;
	--ph-bg: #0c0d0f;
	--ph-surface: #16181b;
	--ph-surface-2: #1f2226;
	--ph-border: #2a2d32;
	--ph-text: #f2f3f5;
	--ph-text-muted: #a6acb5;
	--ph-text-faint: #6d7480;
	--ph-overlay: rgba(0, 0, 0, 0.75);
	--ph-skeleton: #1f2226;
	--ph-skeleton-shine: #292d32;
}

@media (prefers-color-scheme: dark) {
	body[data-color-mode="system"] {
		color-scheme: dark;
		--ph-bg: #0c0d0f;
		--ph-surface: #16181b;
		--ph-surface-2: #1f2226;
		--ph-border: #2a2d32;
		--ph-text: #f2f3f5;
		--ph-text-muted: #a6acb5;
		--ph-text-faint: #6d7480;
		--ph-overlay: rgba(0, 0, 0, 0.75);
		--ph-skeleton: #1f2226;
		--ph-skeleton-shine: #292d32;
	}
}

/* =========================================================================
   Reset & base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--ph-font);
	background: var(--ph-bg);
	color: var(--ph-text);
	-webkit-font-smoothing: antialiased;
	transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px; height: 1px; overflow: hidden;
}
.playhub-skip-link {
	position: fixed; top: -100px; left: 8px; z-index: 999;
	background: var(--ph-accent); color: var(--ph-accent-ink);
	padding: .6em 1em; border-radius: var(--ph-radius-sm);
	transition: top .15s ease;
}
.playhub-skip-link:focus {
	position: fixed; top: 8px; clip: auto; width: auto; height: auto;
}

:focus-visible {
	outline: 2px solid var(--ph-accent);
	outline-offset: 2px;
}

/* =========================================================================
   Header
   ========================================================================= */
.playhub-header {
	position: sticky; top: 0; z-index: 40;
	background: var(--ph-surface);
	border-bottom: 1px solid var(--ph-border);
}
.playhub-header-inner {
	height: var(--ph-header-h);
	display: flex; align-items: center; gap: 12px;
	padding: 0 16px;
	max-width: 1800px; margin: 0 auto;
}
.playhub-icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 999px;
	color: var(--ph-text);
}
.playhub-icon-btn:hover { background: var(--ph-surface-2); }
.playhub-icon-btn svg { width: 20px; height: 20px; }

.playhub-logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.playhub-logo img { max-height: 32px; width: auto; }
.playhub-logo-text {
	font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em;
	color: var(--ph-text);
}
.playhub-logo-text::after { content: ""; }

.playhub-search { flex: 1 1 auto; display: flex; max-width: 640px; margin: 0 auto; position: relative; }
.playhub-search-field { position: relative; flex: 1; }
.playhub-search-field input[type="search"] {
	width: 100%; height: 40px; padding: 0 16px;
	background: var(--ph-bg); border: 1px solid var(--ph-border);
	border-radius: 999px 0 0 999px; border-right: none;
	color: var(--ph-text);
}
.playhub-search-field input[type="search"]:focus {
	outline: none; border-color: var(--ph-accent); background: var(--ph-surface);
}
.playhub-search-field input::-webkit-search-cancel-button { display: none; }
.playhub-search-submit {
	width: 56px; border: 1px solid var(--ph-border);
	background: var(--ph-surface-2); border-radius: 0 999px 999px 0;
	display: flex; align-items: center; justify-content: center;
}
.playhub-search-submit svg { width: 18px; height: 18px; }
.playhub-search-submit:hover { background: var(--ph-border); }

.playhub-search-suggest {
	position: absolute; top: calc(100% + 6px); left: 0; right: 0;
	background: var(--ph-surface); border: 1px solid var(--ph-border);
	border-radius: var(--ph-radius-md); box-shadow: var(--ph-shadow-md);
	overflow: hidden; z-index: 50;
}
.playhub-suggest-item {
	display: flex; align-items: center; gap: 10px;
	padding: 8px 12px; width: 100%; text-align: left;
}
.playhub-suggest-item:hover, .playhub-suggest-item.is-active { background: var(--ph-surface-2); }
.playhub-suggest-thumb { width: 44px; height: 26px; border-radius: 4px; object-fit: cover; background: var(--ph-surface-2); flex-shrink: 0; }
.playhub-suggest-title { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playhub-suggest-empty { padding: 14px; font-size: .85rem; color: var(--ph-text-muted); }

.playhub-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.playhub-icon-moon { display: none; }
body[data-color-mode="dark"] .playhub-icon-sun,
body.playhub-is-dark .playhub-icon-sun { display: none; }
body[data-color-mode="dark"] .playhub-icon-moon,
body.playhub-is-dark .playhub-icon-moon { display: block; }

/* Category chips row */
.playhub-chips {
	border-top: 1px solid var(--ph-border);
	padding: 10px 16px;
	overflow: hidden;
}
.playhub-chips-track {
	display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
	max-width: 1800px; margin: 0 auto;
}
.playhub-chips-track::-webkit-scrollbar { display: none; }
.playhub-chip {
	flex-shrink: 0; padding: 7px 14px; font-size: .85rem; font-weight: 600;
	background: var(--ph-surface-2); border-radius: 999px; white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
}
.playhub-chip:hover { background: var(--ph-border); }
.playhub-chip.is-active { background: var(--ph-text); color: var(--ph-bg); }
.playhub-chip-tag { background: transparent; border: 1px dashed var(--ph-border); }

/* =========================================================================
   Shell: sidebar + main
   ========================================================================= */
.playhub-shell { display: flex; max-width: 1800px; margin: 0 auto; align-items: flex-start; }

.playhub-sidebar {
	width: var(--ph-sidebar-w); flex-shrink: 0;
	position: sticky; top: calc(var(--ph-header-h) + 53px);
	height: calc(100vh - var(--ph-header-h) - 53px);
	overflow-y: auto;
	padding: 16px 12px;
	transition: width .2s ease, transform .2s ease;
}
.playhub-sidebar-nav a {
	display: flex; align-items: center; gap: 16px;
	padding: 10px 12px; border-radius: var(--ph-radius-sm);
	font-size: .9rem; font-weight: 500; color: var(--ph-text);
}
.playhub-sidebar-nav a:hover { background: var(--ph-surface-2); }
.playhub-sidebar-nav a.is-active { background: var(--ph-surface-2); font-weight: 700; }
.playhub-sidebar-nav svg { width: 20px; height: 20px; flex-shrink: 0; }
.playhub-dot {
	width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
	background: linear-gradient(135deg, var(--ph-accent), var(--ph-surface-2));
}
.playhub-sidebar-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ph-border); }
.playhub-sidebar-heading {
	font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
	color: var(--ph-text-faint); padding: 6px 12px; font-weight: 700;
}

body.playhub-sidebar-collapsed .playhub-sidebar { width: var(--ph-sidebar-w-collapsed); }
body.playhub-sidebar-collapsed .playhub-sidebar span:not(.playhub-dot) { display: none; }
body.playhub-sidebar-collapsed .playhub-sidebar-heading { display: none; }
body.playhub-sidebar-collapsed .playhub-sidebar-nav a { justify-content: center; }

.playhub-sidebar-overlay {
	position: fixed; inset: 0; background: var(--ph-overlay); z-index: 45;
}

.playhub-main { flex: 1 1 auto; min-width: 0; padding: 20px 16px 64px; }

/* =========================================================================
   Hero
   ========================================================================= */
.playhub-hero {
	display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
	gap: 24px; margin-bottom: 32px;
	background: var(--ph-surface); border: 1px solid var(--ph-border);
	border-radius: var(--ph-radius-lg); overflow: hidden; padding: 12px;
}
.playhub-hero-thumb {
	position: relative; display: block; border-radius: var(--ph-radius-md); overflow: hidden;
	aspect-ratio: 16 / 9; background: var(--ph-surface-2);
}
.playhub-hero-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.playhub-hero-thumb:hover img { transform: scale(1.03); }
.playhub-hero-play {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: var(--ph-overlay); opacity: 0; transition: opacity .2s ease;
}
.playhub-hero-thumb:hover .playhub-hero-play { opacity: 1; }
.playhub-hero-play svg { width: 56px; height: 56px; color: #fff; }
.playhub-hero-duration { position: absolute; right: 10px; bottom: 10px; }

.playhub-hero-info { display: flex; flex-direction: column; justify-content: center; padding: 12px 20px 12px 0; gap: 12px; }
.playhub-eyebrow {
	font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
	color: var(--ph-accent);
}
.playhub-hero-title { font-size: 1.5rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.playhub-hero-title a:hover { color: var(--ph-accent); }
.playhub-hero-meta { display: flex; align-items: center; gap: 10px; }
.playhub-hero-channel { font-weight: 700; font-size: .9rem; }
.playhub-hero-stats { font-size: .8rem; color: var(--ph-text-muted); }
.playhub-hero-excerpt {
	font-size: .88rem; color: var(--ph-text-muted); line-height: 1.55;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.playhub-hero-cta { align-self: flex-start; }

/* =========================================================================
   Buttons
   ========================================================================= */
.playhub-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: .85rem;
	background: var(--ph-surface-2); color: var(--ph-text);
	border: 1px solid transparent; transition: transform .1s ease, background-color .15s ease;
}
.playhub-btn:hover { background: var(--ph-border); }
.playhub-btn:active { transform: scale(.97); }
.playhub-btn svg { width: 16px; height: 16px; }
.playhub-btn-accent { background: var(--ph-accent); color: var(--ph-accent-ink); }
.playhub-btn-accent:hover { filter: brightness(1.08); background: var(--ph-accent); }

/* =========================================================================
   Sections & grid
   ========================================================================= */
.playhub-section { margin-bottom: 40px; }
.playhub-section-head {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
	margin-bottom: 16px;
}
.playhub-section-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.playhub-section-desc { font-size: .82rem; color: var(--ph-text-muted); margin-top: 2px; }
.playhub-view-all { font-size: .82rem; font-weight: 700; color: var(--ph-accent); flex-shrink: 0; }
.playhub-view-all:hover { text-decoration: underline; }

.playhub-grid {
	display: grid; gap: 20px 16px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 560px) { .playhub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 760px) { .playhub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .playhub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .playhub-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* =========================================================================
   Video card
   ========================================================================= */
.playhub-card { display: flex; flex-direction: column; }
.playhub-card-thumb {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
	border-radius: var(--ph-radius-md); background: var(--ph-surface-2);
}
.playhub-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.playhub-card:hover .playhub-card-thumb img { transform: scale(1.06); }
.playhub-card-thumb-fallback {
	display: block; width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--ph-accent), var(--ph-surface-2));
}
.playhub-card-badges { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.playhub-badge {
	background: rgba(0,0,0,.78); color: #fff; font-size: .68rem; font-weight: 700;
	padding: 2px 6px; border-radius: 4px; line-height: 1.4;
}
.playhub-badge-hd { background: var(--ph-accent); }

.playhub-card-body { display: flex; gap: 10px; margin-top: 10px; }
.playhub-card-avatar { border-radius: 999px; flex-shrink: 0; width: 36px; height: 36px; }
.playhub-card-meta { min-width: 0; }
.playhub-card-title {
	font-size: .92rem; font-weight: 700; line-height: 1.35;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.playhub-card-title a:hover { color: var(--ph-accent); }
.playhub-card-channel { font-size: .8rem; color: var(--ph-text-muted); margin-top: 4px; }
.playhub-card-stats { font-size: .78rem; color: var(--ph-text-faint); margin-top: 2px; }
.playhub-card-cat a:hover { color: var(--ph-accent); }

.playhub-load-more-wrap { display: flex; justify-content: center; margin-top: 24px; }
.playhub-load-more[disabled] { opacity: .6; cursor: default; }
.playhub-load-more.is-loading::after {
	content: ""; width: 14px; height: 14px; margin-left: 6px; display: inline-block;
	border: 2px solid currentColor; border-top-color: transparent; border-radius: 999px;
	animation: playhub-spin .7s linear infinite;
}
@keyframes playhub-spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Skeletons
   ========================================================================= */
.playhub-skeleton { background: linear-gradient(90deg, var(--ph-skeleton) 25%, var(--ph-skeleton-shine) 37%, var(--ph-skeleton) 63%); background-size: 400% 100%; animation: playhub-shimmer 1.4s ease infinite; border-radius: var(--ph-radius-sm); }
@keyframes playhub-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.playhub-skeleton-card { display: flex; flex-direction: column; }
.playhub-skeleton-thumb { aspect-ratio: 16/9; border-radius: var(--ph-radius-md); }
.playhub-skeleton-body { display: flex; gap: 10px; margin-top: 10px; }
.playhub-skeleton-avatar { width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0; }
.playhub-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.playhub-skeleton-line { height: 10px; width: 100%; }
.playhub-skeleton-line.short { width: 60%; }

.playhub-empty-state { text-align: center; padding: 40px 20px; color: var(--ph-text-muted); font-size: .9rem; }
.playhub-empty-state-page { padding: 80px 20px; }

/* =========================================================================
   Archive / search headers
   ========================================================================= */
.playhub-archive-head { margin-bottom: 24px; }
.playhub-page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }

/* =========================================================================
   Watch page
   ========================================================================= */
.playhub-watch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.playhub-watch-main { min-width: 0; }

.playhub-player { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--ph-radius-lg); overflow: hidden; }
.playhub-player iframe, .playhub-player video { width: 100%; height: 100%; border: 0; display: block; }
.playhub-player-empty, .playhub-player-fallback {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	color: #cfd2d8; text-align: center; padding: 20px;
}

.playhub-watch-title { font-size: 1.3rem; font-weight: 800; margin-top: 18px; line-height: 1.35; }
.playhub-watch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.playhub-watch-channel { display: flex; align-items: center; gap: 12px; }
.playhub-watch-channel-name { font-weight: 700; font-size: .95rem; }
.playhub-watch-stats { font-size: .8rem; color: var(--ph-text-muted); margin-top: 2px; }

.playhub-watch-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.playhub-watch-description {
	margin-top: 18px; padding: 16px; background: var(--ph-surface-2); border-radius: var(--ph-radius-md);
	font-size: .88rem; line-height: 1.65; color: var(--ph-text-muted);
}
.playhub-watch-description p:first-child { margin-top: 0; }

.playhub-watch-comments { margin-top: 32px; }
.comment-list { list-style: none; margin: 20px 0 0; padding: 0; }
.comment-list .comment-body { padding: 14px 0; border-top: 1px solid var(--ph-border); }
.comment-respond input, .comment-respond textarea {
	width: 100%; padding: 10px 12px; background: var(--ph-surface);
	border: 1px solid var(--ph-border); border-radius: var(--ph-radius-sm); color: var(--ph-text);
	margin-top: 6px; margin-bottom: 12px;
}
.comment-respond label { font-size: .82rem; font-weight: 600; }

.playhub-watch-related { position: sticky; top: calc(var(--ph-header-h) + 24px); }
.playhub-related-title { margin-bottom: 14px; }
.playhub-watch-related .playhub-card { display: grid; grid-template-columns: 168px 1fr; gap: 10px; margin-bottom: 14px; }
.playhub-watch-related .playhub-card-body { margin-top: 0; }
.playhub-watch-related .playhub-card-avatar { display: none; }

/* =========================================================================
   Bottom nav (mobile)
   ========================================================================= */
.playhub-bottom-nav {
	display: none;
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
	background: var(--ph-surface); border-top: 1px solid var(--ph-border);
	padding-bottom: env(safe-area-inset-bottom);
}
.playhub-bottom-nav a {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
	padding: 8px 0; font-size: .68rem; font-weight: 600; color: var(--ph-text-muted);
}
.playhub-bottom-nav a.is-active { color: var(--ph-accent); }
.playhub-bottom-nav svg { width: 20px; height: 20px; }

/* =========================================================================
   Footer
   ========================================================================= */
.playhub-footer { border-top: 1px solid var(--ph-border); margin-top: 40px; }
.playhub-footer-inner {
	max-width: 1800px; margin: 0 auto; padding: 28px 16px;
	display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
	font-size: .8rem; color: var(--ph-text-muted);
}
.playhub-footer-social { display: flex; gap: 16px; }
.playhub-footer-social a:hover { color: var(--ph-accent); }

/* =========================================================================
   Toasts (share / copy-link feedback)
   ========================================================================= */
.playhub-toast {
	position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
	background: var(--ph-text); color: var(--ph-bg); padding: 10px 18px; border-radius: 999px;
	font-size: .85rem; font-weight: 600; opacity: 0; pointer-events: none;
	transition: opacity .2s ease, transform .2s ease; z-index: 80;
}
.playhub-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1080px) {
	.playhub-watch { grid-template-columns: 1fr; }
	.playhub-watch-related { position: static; }
}

@media (max-width: 900px) {
	.playhub-sidebar {
		position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
		width: 280px; background: var(--ph-surface);
		transform: translateX(-100%); transition: transform .25s ease;
		padding-top: 20px; height: 100vh;
	}
	body.playhub-sidebar-open .playhub-sidebar { transform: translateX(0); }
	body.playhub-sidebar-open .playhub-sidebar-overlay { display: block; }
	.playhub-sidebar-overlay { display: none; }
	body.playhub-sidebar-collapsed .playhub-sidebar { width: 280px; }
	body.playhub-sidebar-collapsed .playhub-sidebar span { display: inline; }

	.playhub-hero { grid-template-columns: 1fr; }
	.playhub-hero-info { padding: 4px 4px 12px; }
}

@media (max-width: 640px) {
	.playhub-logo-text { display: none; }
	.playhub-header-inner { gap: 8px; padding: 0 10px; }
	.playhub-main { padding: 16px 10px 90px; }
	.playhub-bottom-nav { display: flex; }
	.playhub-footer { margin-bottom: 56px; }
	.playhub-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 10px; }
	.playhub-watch-related .playhub-card { grid-template-columns: 128px 1fr; }
}

@media (max-width: 420px) {
	.playhub-grid { grid-template-columns: 1fr; }
}
