/**
 * HyperPlayer frontend styles.
 *
 * All rules are scoped under .hyperplayer to avoid bleeding into the host
 * theme. Skin colors come from CSS custom properties printed inline by
 * HyperPlayer_Assets — that lets each install have its own palette
 * without per-site stylesheets.
 *
 * Layout philosophy: aspect-ratio is enforced via padding-bottom on
 * .hyperplayer__media so the player keeps its shape on responsive layouts
 * even before the video has loaded its metadata.
 */

.hyperplayer {
	margin: 0 auto 1.25rem;
	padding: 0;
	max-width: 100%;
	font-family: inherit;
	color: inherit;
}

.hyperplayer--align-left   { margin-left: 0; margin-right: auto; }
.hyperplayer--align-center { margin-left: auto; margin-right: auto; }
.hyperplayer--align-right  { margin-left: auto; margin-right: 0; }
.hyperplayer--align-none   { margin: 0; display: inline-block; }

.hyperplayer__caption {
	font-size: 0.95em;
	line-height: 1.3;
	margin: 0 0 0.4em;
	color: inherit;
	opacity: 0.85;
}

.hyperplayer__media {
	position: relative;
	width: 100%;
	height: 0;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
	/* padding-bottom set inline per-instance to enforce aspect ratio */
}

.hyperplayer__video,
.hyperplayer__iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
}

/* Skin tweaks for native controls — works in webkit; harmless elsewhere. */
.hyperplayer__video::-webkit-media-controls-panel {
	background-color: var(--hp-control-bg, rgba(0, 0, 0, 0.7));
}
.hyperplayer__video::-webkit-media-controls-play-button,
.hyperplayer__video::-webkit-media-controls-timeline {
	filter: drop-shadow(0 0 0 var(--hp-primary, #7c3aed));
}

/* Logo overlay */
.hyperplayer__logo {
	position: absolute;
	z-index: 5;
	pointer-events: none;
	max-width: 30%;
	max-height: 25%;
}
.hyperplayer__logo--top-left     { top: 8px;    left: 8px;   }
.hyperplayer__logo--top-right    { top: 8px;    right: 8px;  }
.hyperplayer__logo--bottom-left  { bottom: 56px; left: 8px;  }
.hyperplayer__logo--bottom-right { bottom: 56px; right: 8px; }
.hyperplayer__logo-link { pointer-events: auto; }
.hyperplayer__logo-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	transition: opacity 0.2s ease;
}

/* Pre-roll ad layer.
   Sits on top of the main player while an ad runs. The shared shell hosts
   one of three ad-content types: VAST iframe (planted by IMA), <video>
   element (MP4), or <a><img></a> (image). The skip button and countdown
   badge are chrome that floats above the content.
*/
.hyperplayer__ad-layer {
	position: absolute;
	inset: 0;
	z-index: 10;
	background: #000;
	overflow: hidden;
}
.hyperplayer__ad-layer::before {
	content: 'AD';
	position: absolute;
	left: 12px;
	top: 12px;
	z-index: 12;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 11px;
	letter-spacing: 0.1em;
	font-family: inherit;
	padding: 4px 8px;
	border-radius: 2px;
	pointer-events: none;
}

.hyperplayer__ad-content {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.hyperplayer__ad-content > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.hyperplayer__ad-video {
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	cursor: pointer;
}
.hyperplayer__ad-image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* Skip button — pinned bottom-right of the ad layer. */
.hyperplayer__ad-skip {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 13;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.4);
	padding: 8px 14px;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	border-radius: 3px;
	letter-spacing: 0.02em;
	transition: background 0.15s ease;
}
.hyperplayer__ad-skip:hover:not([disabled]) { background: rgba(0, 0, 0, 0.95); }
.hyperplayer__ad-skip[disabled] { cursor: default; opacity: 0.85; }

/* Countdown badge — pinned top-right, sibling of the AD label. */
.hyperplayer__ad-countdown {
	position: absolute;
	right: 12px;
	top: 12px;
	z-index: 13;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 12px;
	font-family: inherit;
	padding: 4px 10px;
	border-radius: 2px;
	pointer-events: none;
	min-width: 90px;
	text-align: center;
}

/* AdSense overlay banner.
   Sized to match a standard 300x90 ad unit. Positioned to stay clear of
   player controls (bottom-right is the policy-safest default). */
.hyperplayer__overlay-ad {
	position: absolute;
	z-index: 8;
	max-width: 300px;
	max-height: 90px;
	transition: opacity 0.3s ease;
}
.hyperplayer__overlay-ad--top {
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
}
/* Bottom-anchored overlay positions sit clear of the control bar (~46px tall)
   PLUS at least 5px breathing room on top of that. */
.hyperplayer__overlay-ad--bottom {
	bottom: 64px;
	left: 50%;
	transform: translateX(-50%);
}
.hyperplayer__overlay-ad--bottom-right {
	bottom: 64px;
	right: 12px;
}
.hyperplayer__overlay-ad--bottom-left {
	bottom: 64px;
	left: 12px;
}
.hyperplayer__overlay-ad ins.adsbygoogle {
	display: inline-block;
	max-width: 100%;
	max-height: 100%;
}
.hyperplayer__overlay-ad-close {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 0;
	background: #000;
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	line-height: 24px;
	font-family: inherit;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9;
}
.hyperplayer__overlay-ad-close:hover { background: var(--hp-primary, #7c3aed); }

.hyperplayer-error {
	background: #fff4f4;
	border: 1px solid #f5c6c6;
	color: #8a1f1f;
	padding: 0.75em 1em;
	font-size: 14px;
	border-radius: 3px;
}
