/* Bunny Pro Player */
.bpp {
	--bpp-accent: #ff3d71;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	color: #fff;
	overflow: hidden;
	border-radius: 12px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	touch-action: manipulation;
	isolation: isolate;
}
.bpp *, .bpp *::before, .bpp *::after { box-sizing: border-box; }
.bpp button { font-family: inherit; }
.bpp [hidden] { display: none !important; }

.bpp-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	background: #000;
}
.bpp-tap { position: absolute; inset: 0; z-index: 3; }
.bpp.bpp-playing:not(.bpp-ui) { cursor: none; }

/* ------------------------------------------------------------ top title */
.bpp-top {
	position: absolute;
	top: 0; left: 0; right: 0;
	z-index: 6;
	padding: 14px 16px 34px;
	background: linear-gradient(rgba(0, 0, 0, .7), transparent);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
	display: none;
}
.bpp-has-title .bpp-top { display: block; }
.bpp-ui .bpp-top { opacity: 1; }
.bpp-title {
	font-size: 16px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.bpp-fs-on .bpp-title { font-size: 20px; }

/* ------------------------------------------------------- big centre btn */
.bpp-center {
	position: absolute;
	top: 46%; left: 50%;
	z-index: 8;
	width: 76px; height: 76px;
	margin: -38px 0 0 -38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3);
	color: #fff;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform .2s ease, background .2s ease;
}
.bpp-center svg { width: 40px; height: 40px; display: block; }
.bpp-paused:not(.bpp-loading) .bpp-center { display: flex; }
.bpp-center:hover { background: var(--bpp-accent); transform: scale(1.07); }
.bpp-center:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.bpp-spinner {
	position: absolute;
	top: 50%; left: 50%;
	z-index: 5;
	width: 52px; height: 52px;
	margin: -26px 0 0 -26px;
	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, .2);
	border-top-color: var(--bpp-accent);
	animation: bpp-spin .8s linear infinite;
	display: none;
	pointer-events: none;
}
.bpp-loading .bpp-spinner { display: block; }
@keyframes bpp-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------- double-tap seek ripples */
.bpp-ripple {
	position: absolute;
	top: 0; bottom: 0;
	width: 34%;
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: rgba(255, 255, 255, .16);
	opacity: 0;
	pointer-events: none;
}
.bpp-rl { left: 0; border-radius: 0 999px 999px 0; }
.bpp-rr { right: 0; border-radius: 999px 0 0 999px; }
.bpp-ripple.bpp-go { animation: bpp-rip .8s ease-out; }
@keyframes bpp-rip { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.bpp-rip-ic svg { width: 34px; height: 34px; display: block; }
.bpp-rl .bpp-rip-ic { transform: rotate(180deg); }
.bpp-rip-tx { font-size: 13px; font-weight: 600; }

.bpp-toast {
	position: absolute;
	top: 14%; left: 50%;
	z-index: 8;
	transform: translateX(-50%);
	padding: 8px 14px;
	border-radius: 20px;
	background: rgba(0, 0, 0, .72);
	font-weight: 600;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	white-space: nowrap;
}
.bpp-toast.bpp-on { opacity: 1; }

/* ------------------------------------------------------------ controls */
.bpp-controls {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	z-index: 7;
	padding: 34px 12px 8px;
	background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .45) 55%, transparent);
	opacity: 0;
	transform: translateY(6px);
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease;
}
.bpp-ui .bpp-controls { opacity: 1; transform: none; pointer-events: auto; }

.bpp-progress {
	position: relative;
	height: 18px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
	outline: none;
}
.bpp-rail {
	position: relative;
	width: 100%;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .28);
	transition: height .12s ease;
}
.bpp-progress:hover .bpp-rail,
.bpp-scrub .bpp-rail,
.bpp-progress:focus-visible .bpp-rail { height: 5px; }
.bpp-buf, .bpp-played {
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 0;
	border-radius: inherit;
}
.bpp-buf { background: rgba(255, 255, 255, .42); }
.bpp-played { background: var(--bpp-accent); }
.bpp-knob {
	position: absolute;
	top: 50%; left: 0;
	width: 14px; height: 14px;
	margin: -7px 0 0 -7px;
	border-radius: 50%;
	background: var(--bpp-accent);
	transform: scale(0);
	transition: transform .12s ease;
}
.bpp-progress:hover .bpp-knob,
.bpp-scrub .bpp-knob,
.bpp-progress:focus-visible .bpp-knob { transform: scale(1); }
.bpp-tip {
	position: absolute;
	bottom: 24px; left: 0;
	transform: translateX(-50%);
	padding: 4px 8px;
	border-radius: 6px;
	background: rgba(15, 15, 18, .92);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity .1s ease;
}
.bpp-progress:hover .bpp-tip, .bpp-scrub .bpp-tip { opacity: 1; }

.bpp-bar { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.bpp-spacer { flex: 1 1 auto; }

.bpp-btn {
	flex: none;
	width: 42px; height: 42px;
	margin: 0; padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}
.bpp-btn svg { width: 26px; height: 26px; display: block; }
.bpp-btn:hover { background: rgba(255, 255, 255, .15); }
.bpp-btn:active { transform: scale(.92); }
.bpp-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.bpp-pip-on .bpp-pip { color: var(--bpp-accent); }

/* ------------------------------------------------------------- volume */
.bpp-volwrap { display: flex; align-items: center; }
.bpp-vol {
	width: 0;
	height: 42px;
	overflow: hidden;
	opacity: 0;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
	outline: none;
	transition: width .22s cubic-bezier(.4, 0, .2, 1), opacity .18s ease, margin .22s ease;
}
.bpp-volwrap:hover .bpp-vol,
.bpp-volopen .bpp-vol,
.bpp-vol.bpp-drag,
.bpp-vol:focus-visible {
	width: 84px;
	opacity: 1;
	margin: 0 6px 0 0;
}
.bpp-vol-rail {
	position: relative;
	flex: none;
	width: 70px;
	height: 4px;
	margin-left: 8px;
	border-radius: 4px;
	background: rgba(255, 255, 255, .3);
}
.bpp-vol-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: #fff; }
.bpp-vol-knob {
	position: absolute;
	top: 50%; left: 0;
	width: 13px; height: 13px;
	margin: -6.5px 0 0 -6.5px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 4px rgba(0, 0, 0, .5);
}
.bpp-novol .bpp-vol { display: none; }

.bpp-time {
	padding: 0 8px;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.bpp-sep { opacity: .7; }

/* --------------------------------------------------------- settings menu */
.bpp-menu {
	position: absolute;
	right: 12px;
	bottom: 70px;
	z-index: 9;
	min-width: 230px;
	max-width: calc(100% - 24px);
	max-height: calc(100% - 90px);
	overflow: auto;
	padding: 6px;
	border-radius: 12px;
	background: rgba(18, 18, 22, .95);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .55);
}
.bpp-mi {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 11px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}
.bpp-mi:hover { background: rgba(255, 255, 255, .1); }
.bpp-mi:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.bpp-mi-ic { width: 20px; height: 20px; flex: none; display: inline-flex; }
.bpp-mi-ic svg { width: 20px; height: 20px; display: block; }
.bpp-mi-tx { flex: 1 1 auto; }
.bpp-mv { margin-left: auto; opacity: .7; white-space: nowrap; }
.bpp-sel .bpp-mi-ic { color: var(--bpp-accent); }
.bpp-mh { font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, .12); border-radius: 8px 8px 0 0; margin-bottom: 4px; }

/* ----------------------------------------------------------- brand logo */
.bpp-logo {
	position: absolute;
	top: 0; left: 0;
	z-index: 2;
	height: auto;
	max-width: 30%;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5));
	transition-property: transform;
	transition-timing-function: cubic-bezier(.45, 0, .25, 1);
	transition-duration: 0s;
	will-change: transform;
}

/* --------------------------------------------------------------- error */
.bpp-error {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: #000;
	text-align: center;
}
.bpp-err-box { max-width: 460px; }
.bpp-err-box strong { display: block; margin-bottom: 8px; font-size: 16px; }
.bpp-err-box span { display: block; font-size: 13px; line-height: 1.5; opacity: .8; }

/* ---------------------------------------------------------- fullscreen */
.bpp:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.bpp:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.bpp.bpp-pfs {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	aspect-ratio: auto !important;
	border-radius: 0 !important;
	z-index: 2147483000 !important;
}
html.bpp-lock, html.bpp-lock body { overflow: hidden !important; }

/* -------------------------------------------------------------- mobile */
@media (max-width: 560px) {
	.bpp { border-radius: 8px; font-size: 13px; }
	.bpp-controls { padding: 28px 6px 4px; }
	.bpp-btn { width: 40px; height: 40px; }
	.bpp-btn svg { width: 24px; height: 24px; }
	.bpp-pip { display: none; }
	.bpp-time { padding: 0 4px; font-size: 12px; }
	.bpp-volopen .bpp-time { display: none; }
	.bpp-center { width: 58px; height: 58px; margin: -29px 0 0 -29px; top: 44%; }
	.bpp-center svg { width: 32px; height: 32px; }
	.bpp-menu { left: 8px; right: 8px; bottom: 62px; min-width: 0; }
	.bpp-title { font-size: 14px; }
	.bpp-rip-ic svg { width: 28px; height: 28px; }
}
@media (pointer: coarse) {
	.bpp-btn { width: 44px; height: 44px; }
	.bpp-progress { height: 24px; }
	.bpp-rail { height: 4px; }
	.bpp-knob { transform: scale(1); }
	.bpp-tip { bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) {
	.bpp *, .bpp *::before, .bpp *::after { transition: none !important; animation-duration: .01s !important; }
	.bpp-spinner { animation: bpp-spin 2s linear infinite !important; }
}
