/* Mirror Video Gallery – player */
.mvg-player {
	--mvg-accent: #e11d48;
	--mvg-crop: max(96px, 16%); /* refined by the player script from the real scale */
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #000;
	border-radius: 12px;
	color: #fff;
	font: 500 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
	direction: ltr;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	isolation: isolate;
}
.mvg-player::before { content: ""; display: block; padding-top: var(--mvg-ratio, 56.25%); }
.mvg-player:focus-visible { box-shadow: 0 0 0 3px var(--mvg-accent); }
.mvg-player *, .mvg-player *::before, .mvg-player *::after { box-sizing: border-box; }
.mvg-player svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.mvg-player button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
.mvg-player [hidden] { display: none !important; }

/* Engine stage: oversized + cropped so the engine's own top/bottom chrome is never visible. */
.mvg-stage { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.mvg-frame { position: absolute; left: 0; right: 0; top: calc(-1 * var(--mvg-crop)); bottom: calc(-1 * var(--mvg-crop)); }
.mvg-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; pointer-events: none !important; }
.mvg-frame video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none !important; }

/* Pause blur hides the engine's pause overlays/suggestions while still showing the frame. */
.mvg-blur { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .25s;
	-webkit-backdrop-filter: blur(22px) brightness(.55); backdrop-filter: blur(22px) brightness(.55); background: rgba(0,0,0,.25); }
.mvg-player.is-paused .mvg-blur { opacity: 1; }
.mvg-player.mvg-nopauseblur.is-paused .mvg-blur { opacity: 0; }

/* Shield: sits over the engine and swallows every pointer event (no right-click / link-out on the engine). */
.mvg-shield { position: absolute; inset: 0; z-index: 3; cursor: pointer; background: transparent; }
.mvg-player.mvg-idle, .mvg-player.mvg-idle .mvg-shield { cursor: none; }

/* Subtitles (site-hosted VTT/SRT, rendered by the player). */
.mvg-cc { position: absolute; z-index: 4; left: 4%; right: 4%; bottom: 7%; text-align: center; pointer-events: none; transition: bottom .25s; unicode-bidi: plaintext; }
.mvg-cc span { display: inline-block; max-width: 100%; padding: .15em .5em; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff;
	font-size: clamp(14px, 2.4vw, 26px); line-height: 1.4; font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.mvg-player.mvg-started:not(.mvg-idle) .mvg-cc { bottom: 82px; }
.mvg-player.mvg-fs .mvg-cc span { font-size: clamp(20px, 2.6vw, 40px); }
.mvg-player:not(.mvg-started) .mvg-cc, .mvg-player.mvg-ended .mvg-cc { display: none; }

.mvg-wm { position: absolute; z-index: 4; pointer-events: none; white-space: nowrap; font-weight: 600; font-size: clamp(11px, 1.6vw, 16px);
	color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); transition: left 2s ease, top 2s ease; left: 10%; top: 10%; }
.mvg-player:not(.mvg-has-wm) .mvg-wm { display: none; }

/* Poster (before start / ended / locked). */
.mvg-poster { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #0b0b0f; }
.mvg-poster-img { position: absolute; inset: 0; background: center / cover no-repeat; }
.mvg-poster.no-img .mvg-poster-img { background: radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--mvg-accent) 45%, #111) 0%, #0b0b0f 70%); }
.mvg-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0) 60%, rgba(0,0,0,.55) 100%); }
.mvg-poster-title { position: absolute; z-index: 1; top: 14px; left: 18px; right: 18px; font-size: clamp(14px, 2vw, 20px); font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvg-big { position: relative; z-index: 1; width: clamp(56px, 10vw, 84px); height: clamp(56px, 10vw, 84px); border-radius: 50% !important;
	background: var(--mvg-accent) !important; display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.45); transition: transform .2s; }
.mvg-big svg { width: 50%; height: 50%; }
.mvg-poster:hover .mvg-big { transform: scale(1.08); }
.mvg-player.mvg-started:not(.mvg-ended) .mvg-poster { display: none; }
.mvg-player.mvg-loading .mvg-big { opacity: .0; }

/* Spinner */
.mvg-spinner { position: absolute; z-index: 7; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
	border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: mvg-spin .8s linear infinite; display: none; pointer-events: none; }
.mvg-player.mvg-loading .mvg-spinner, .mvg-player.mvg-buffering.mvg-started .mvg-spinner { display: block; }
@keyframes mvg-spin { to { transform: rotate(360deg); } }

/* Feedback flash */
.mvg-flash { position: absolute; z-index: 7; left: 50%; top: 50%; transform: translate(-50%,-50%); pointer-events: none; opacity: 0;
	background: rgba(0,0,0,.55); border-radius: 999px; min-width: 64px; height: 64px; padding: 0 18px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.mvg-flash svg { width: 32px; height: 32px; }
.mvg-flash.on { animation: mvg-pop .6s ease forwards; }
@keyframes mvg-pop { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.85); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.25); } }
.mvg-dbl { position: absolute; z-index: 7; top: 0; bottom: 0; width: 35%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; pointer-events: none; opacity: 0; }
.mvg-dbl-l { left: 0; background: radial-gradient(circle at 0 50%, rgba(255,255,255,.18), transparent 70%); }
.mvg-dbl-r { right: 0; background: radial-gradient(circle at 100% 50%, rgba(255,255,255,.18), transparent 70%); }
.mvg-dbl.on { animation: mvg-fade .6s ease; }
@keyframes mvg-fade { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }

/* Resume + unmute chips */
.mvg-resume { position: absolute; z-index: 8; left: 50%; bottom: 18%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
	background: rgba(15,15,20,.88); padding: 8px 10px 8px 16px; border-radius: 999px; white-space: nowrap; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.mvg-rb { background: rgba(255,255,255,.12) !important; border-radius: 999px !important; padding: 6px 12px !important; display: inline-flex; align-items: center; gap: 6px; }
.mvg-rb svg { width: 18px; height: 18px; }
.mvg-rb-yes { background: var(--mvg-accent) !important; padding: 6px 10px !important; }
.mvg-unmute { position: absolute !important; z-index: 8; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px;
	background: rgba(15,15,20,.85) !important; padding: 7px 12px !important; border-radius: 999px !important; font-weight: 600; }
.mvg-unmute svg { width: 18px; height: 18px; }

/* Control bar */
.mvg-bar { position: absolute; z-index: 9; left: 0; right: 0; bottom: 0; padding: 26px 10px 6px; background: linear-gradient(transparent, rgba(0,0,0,.75));
	transition: opacity .25s, transform .25s; }
.mvg-player:not(.mvg-started) .mvg-bar, .mvg-player.mvg-ended .mvg-bar, .mvg-player.mvg-locked .mvg-bar { opacity: 0; pointer-events: none; }
.mvg-player.mvg-idle .mvg-bar { opacity: 0; transform: translateY(8px); pointer-events: none; }
.mvg-row { display: flex; align-items: center; gap: 2px; }
.mvg-b { width: 40px; height: 40px; display: grid !important; place-items: center; border-radius: 8px !important; opacity: .92; transition: background .15s, opacity .15s; }
.mvg-b:hover, .mvg-b:focus-visible { background: rgba(255,255,255,.14) !important; opacity: 1; outline: none; }
.mvg-b-cc.is-on { color: var(--mvg-accent); }
.mvg-b-cc.is-on::after { content: ""; position: absolute; }
.mvg-sp { flex: 1; }
.mvg-time { font-variant-numeric: tabular-nums; font-size: 13px; padding: 0 8px; opacity: .95; white-space: nowrap; }
.mvg-player.mvg-menu-open .mvg-b-gear svg { transform: rotate(45deg); }
.mvg-b-gear svg { transition: transform .25s; }

.mvg-vol { display: flex; align-items: center; }
.mvg-vol-range { -webkit-appearance: none; appearance: none; width: 0; opacity: 0; height: 4px; margin: 0; border-radius: 4px; cursor: pointer; transition: width .2s, opacity .2s, margin .2s;
	background: linear-gradient(to right, #fff var(--v, 100%), rgba(255,255,255,.3) var(--v, 100%)); }
.mvg-vol:hover .mvg-vol-range, .mvg-vol:focus-within .mvg-vol-range { width: 72px; opacity: 1; margin: 0 8px 0 4px; }
.mvg-vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.mvg-vol-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }

/* Progress */
.mvg-progress { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; margin: 0 6px 2px; touch-action: none; }
.mvg-rail { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; transition: height .15s; }
.mvg-progress:hover .mvg-rail { height: 6px; }
.mvg-buf, .mvg-played { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.mvg-buf { background: rgba(255,255,255,.4); }
.mvg-played { background: var(--mvg-accent); }
.mvg-knob { position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--mvg-accent); transform: scale(0); transition: transform .15s; }
.mvg-progress:hover .mvg-knob { transform: scale(1); }
.mvg-tip { position: absolute; bottom: 22px; left: 0; transform: translateX(-50%); background: rgba(15,15,20,.9); padding: 3px 7px; border-radius: 6px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .1s; white-space: nowrap; }
.mvg-progress:hover .mvg-tip { opacity: 1; }

/* Live (5.41.0): badge instead of time + seek bar; red dot = at the live edge, click = jump to live. */
.mvg-live-b { display: inline-flex !important; align-items: center; gap: 7px; height: 28px; margin: 0 6px !important; padding: 0 11px !important; border-radius: 999px !important;
	background: rgba(255,255,255,.14) !important; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mvg-live-b:hover, .mvg-live-b:focus-visible { background: rgba(255,255,255,.24) !important; outline: none; }
.mvg-live-b i { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex: none; }
.mvg-live-b.is-edge { cursor: default; }
.mvg-live-b.is-edge i { background: #ef4444; animation: mvg-live 1.6s ease-out infinite; }
@keyframes mvg-live { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.65); } 100% { box-shadow: 0 0 0 7px rgba(239,68,68,0); } }
.mvg-player.mvg-live .mvg-progress, .mvg-player.mvg-live .mvg-time, .mvg-player.mvg-live .mvg-b-back,
.mvg-player.mvg-live .mvg-b-fwd, .mvg-player.mvg-live .mvg-dbl { display: none !important; }
.mvg-player.mvg-live .mvg-bar { padding-top: 34px; }

/* Settings menu */
.mvg-menu { position: absolute; z-index: 10; right: 12px; bottom: 64px; min-width: 230px; max-height: calc(100% - 80px); overflow-y: auto; background: rgba(20,20,26,.94);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 12px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.mvg-mi, .mvg-mh { display: flex !important; align-items: center; width: 100%; gap: 8px; padding: 9px 12px !important; border-radius: 8px !important; text-align: left; }
.mvg-mi:hover, .mvg-mh:hover, .mvg-mi:focus-visible { background: rgba(255,255,255,.1) !important; outline: none; }
.mvg-mi span { flex: 1; }
.mvg-mi em { font-style: normal; opacity: .7; font-size: 13px; }
.mvg-mi em::after { content: "›"; margin-left: 8px; }
.mvg-mi i { width: 20px; display: inline-flex; }
.mvg-mi i svg { width: 18px; height: 18px; color: var(--mvg-accent); }
.mvg-mi.is-active { font-weight: 700; }
.mvg-mh { border-bottom: 1px solid rgba(255,255,255,.12) !important; border-radius: 8px 8px 0 0 !important; margin-bottom: 4px; font-weight: 700; }
.mvg-mh svg { width: 20px; height: 20px; }

/* Messages / lock / blackout */
.mvg-msg { position: absolute; z-index: 11; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center; background: rgba(8,8,12,.92); }
.mvg-msg p { margin: 0; max-width: 420px; }
.mvg-msg svg { width: 40px; height: 40px; color: var(--mvg-accent); }
.mvg-player.mvg-black::after { content: ""; position: absolute; inset: 0; z-index: 20; background: #000; }

/* Fullscreen */
.mvg-player.mvg-fs { border-radius: 0; width: 100%; height: 100%; }
.mvg-player.mvg-fs::before { display: none; }
.mvg-player:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.mvg-player:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }
.mvg-player.mvg-pseudo-fs { position: fixed !important; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh; }
html.mvg-lock-scroll, html.mvg-lock-scroll body { overflow: hidden !important; }

/* Selection guard */
html.mvg-noselect-on .mvg-player, html.mvg-noselect-on .mvg-grid, html.mvg-noselect-on .mvg-playlist,
body.mvg-noselect .mvg-single, body.mvg-noselect .mvg-grid, body.mvg-noselect .mvg-playlist { -webkit-user-select: none; user-select: none; }
.mvg-player img, .mvg-grid img, .mvg-playlist img { -webkit-user-drag: none; pointer-events: none; }

@media (max-width: 560px) {
	.mvg-b-back, .mvg-b-fwd, .mvg-vol-range { display: none !important; }
	.mvg-b { width: 36px; height: 36px; }
	.mvg-time { font-size: 12px; padding: 0 4px; }
	.mvg-menu { right: 6px; left: 6px; bottom: 56px; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.mvg-player *, .mvg-player *::before { transition: none !important; animation-duration: .01s !important; }
}
