/* RESET */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}

.clear {
        clear: both;
}

.cover {
	background-size: cover;
	background-position: center center;
}

.transition( @target: all, @duration: 400ms, @type: ease, @delay: 0s ) {
	-webkit-transition: @target @duration @type @delay;
	-moz-transition: @target @duration @type @delay;
	-ms-transition: @target @duration @type @delay;
	-o-transition: @target @duration @type @delay;
	transition: @target @duration @type @delay;
}

.border-radius( @value: 1000px ) {
	-webkit-border-radius: @value;
	border-radius: @value;
	-webkit-background-clip: padding-box; 
	-moz-background-clip: padding; 
	background-clip: padding-box;
}

.contain {
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
}

.rotate( @value: 0deg ) {
	-webkit-transform: rotate( @value );
	-moz-transform: rotate( @value );
	-ms-transform: rotate( @value );
	-o-transform: rotate( @value );
	transform: rotate( @value );
}

.box-sizing {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

html, body {
}

/*================================*/

@width: 1100px;

.page {
	background-image: url(../images/bg.jpg);
	min-width: @width;
	padding: 50px 0;
	.cover;
	
	.container {
		position: relative;
		width: @width;
		margin: 0 auto;
	}
	
	.start {
		height: 430px;
	
		.shield {
			position: absolute;
			width: 111px;
			height: 146px;
			left: 50px;
			top: 0px;
			background-image: url(../images/s.png);
		}
		
		.title {
			position: absolute;
			width: 497px;
			height: 157px;
			left: 230px;
			top: 0px;
			background-image: url(../images/t1.png);
		}
		
		.subtitle {
			position: absolute;
			width: 200px;
			height: 157px;
			right: 30px;
			top: 0px;
			background-image: url(../images/t2.png);
		}
		
		.description {
			position: absolute;
			width: 640px;
			left: 230px;
			top: 200px;
			font-family: 'trivia-grotesk';
			font-size: 16px;
			line-height: 22px;
		}
	}
	
	.action {
		@w: 650px;
		@h: 455px;
		
		.load-image-button {
			position: absolute;
			width: 170px;
			height: 70px;
			left: 0px;
			top: 180px;
			cursor: pointer;
			background-image: url(../images/upload.png);
			opacity: 0.8;
			
			&:hover {
				opacity: 1;
			}
			
			&.wait {
				&:after {
					content: '';
					position: absolute;
					z-index: 2;
					left: 0;
					top: 0;
					width: 100%;
					height: 100%;
					background-color: rgba(255, 255, 255, 0.75);
					cursor: default;
				}
			}
			
			.qq-uploader {
				position: absolute;
				z-index: 1;
				left: 0;
				top: 0;
				width: 100%;
				height: 100%;
				
				.qq-upload-button {
					position: absolute;
					left: 0;
					top: 0;
					width: 100%;
					height: 100%;
					
					div {
						display: none;
					}
					
					input {
						position: absolute;
						z-index: 2;
						left: 0;
						top: 0;
						width: 100%;
						height: 100%;
					}
				}
				
				.qq-upload-drop-area, .qq-drop-processing, .qq-upload-list {
					display: none !important;
				}
			}
		}
		
		.controllers {
			@w: 150px;
		
			position: absolute;
			width: @w;
			right: 0;
			top: 90px;
			
			.item {
				display: block;
				cursor: pointer;
			
				&.social {
					width: @w;
					height: 45px;
					background-image: url(../images/btnShare.png);
					margin-bottom: 10px;
				
					&.fb {
						background-position: 0px 0px;
						
						&:hover {
							background-position: 0px -46px;
						}
					}
					
					&.vk {
						background-position: -330px 0px;
						
						&:hover {
							background-position: -330px -46px;
						}
					}
					
					&.tw {
						background-position: -165px 0px;
						
						&:hover {
							background-position: -165px -46px;
						}
					}
				}
				
				&.save {
					height: 45px;
					background-image: url(../images/save.png);
					background-position: 0px 0px;
					margin-top: 40px;
					
					&:hover {
						background-position: 0px -46px;
					}
				}
				
				&.download {
					display: none;
					height: 45px;
					background-image: url(../images/download.png);
					background-position: 0px 0px;
					margin-top: 40px;
					
					&:hover {
						background-position: 0px -46px;
					}
				}
			}
			
			&.wait {
				.item {
					opacity: 0.5;
					pointer-events: none;
				}
			}
			
			&.can-download {
				.save {
					display: none !important;
				}
				
				.download {
					display: block !important;
				}
			}
		}
	
		.canvas {
			position: relative;
			width: @w;
			height: @h;
			margin: 0 auto;
			background-color: rgba(0, 0, 0, 0.25);
			
			.bg {
				position: absolute;
				z-index: 1;
				left: 0;
				top: 0;
				width: 100%;
				height: 100%;
				.cover;
			}
			
			.object {
				position: absolute;
				z-index: 2;
				width: 120px;
				height: 360px;
				left: 276px;
				top: 37px;
				border: 1px dashed rgba(0, 0, 0, 0);
				.box-sizing;
				
				.image {
					position: absolute;
					z-index: 1;
					left: 0;
					top: 0;
					width: 100%;
					height: 100%;
					background-image: url(../images/m.png);
					.contain;
				}
				
				.move {
					position: absolute;
					z-index: 2;
					left: 0;
					top: 0;
					width: 100%;
					height: 100%;
					cursor: move;
				}
				
				.resize {
					@s: 20px;
					
					position: absolute;
					z-index: 3;
					right: -@s / 2;
					bottom: -@s / 2;
					width: @s;
					height: @s;
					opacity: 0;
					cursor: nwse-resize;
					background-image: url(../images/resize.png);
					.contain;
				}
				
				&:hover, &.dragged {
					border-color: rgba(0, 0, 0, 1);
					
					.resize {
						opacity: 1;
					}
				}
				
				&:active {
					/*.image {
						background-color: rgba(255, 255, 255, 0.25);
					}*/
				}
			}
		}
		
		.hint {
			padding: 30px 0;
			text-align: center;
			font-family: 'trivia-serif';
			font-size: 16px;
		}
		
		.preset {
			@ww: 150px;
			@n: 7;
			@g: (@width - @n * @ww) / (@n - 1);
		
			.item {
				float: left;
				width: @ww;
				height: 90px;
				margin-right: @g;
				margin-bottom: @g;
				opacity: 0.9;
				cursor: pointer;
				.cover;
				
				&:nth-child(7n) {
					margin-right: 0;
				}
				
				&:hover {
					opacity: 1;
				}
			}
		}
	}
}

.page.mobile {
	
}