html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: #232321;
  height: 100%;
}

html.inline-element {
  background: rgba(0, 0, 0, 0.6);
}

body {
  color: #ffe753;
  font: 14px 'Open Sans', Arial, sans-serif;
  min-height: 100%;
  min-width: 990px;
  position: relative;
}

.invisible {
  display: none;
}

.hidden {
  visibility: hidden;
}

.filters {
  text-align: center;
  padding: 15px 0;
}

.filters-item {
  cursor: pointer;
  font-size: 18px;
  line-height: 30px;
  padding: 0 16px;
  text-decoration: underline;
}

.filters-radio {
  left: -100px;
  position: absolute;
  right: -100px;
}

.filters-radio:checked + .filters-item {
  background: #fff;
  border-radius: 2px;
  color: #000;
  text-decoration: none;
}

.upload {
  background: url('../img/logo-background-1.jpg') center;
  border: 0;
  height: 569px;
  left: 50%;
  margin: 5px 0 0 -291px;
  margin-top: 5px;
  padding: 0;
  position: absolute;
  width: 574px;
}

.upload-overlay {
  border: none;
  height: 100%;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
}

.upload-form {
  height: 569px;
  width: 574px;
}

.upload-image {
  background: url('../img/logo-mask.png') no-repeat center;
  position: relative;
  z-index: 1;
}

.upload-resize,
.upload-filter {
  background: rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.resize-image-preview,
.filter-image-preview {
  max-width: 582px;
  max-height: 507px;
}

.filter-chrome {
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
}

.filter-sepia {
  -webkit-filter: sepia(1);
  filter: sepia(1);
}

.upload-input {
  visibility: hidden;
}

.upload-control {
  background: url('../img/icon-photo.png') center no-repeat;
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  height: 182px;
  margin: 0;
  left: 198px;
  padding: 0;
  position: absolute;
  top: 193px;
  width: 182px;
}

.upload-submit {
  background-image: url('../img/upload-button.png');
}

.upload-file {
  display: block;
}

.upload-submit {
  display: none;
}

.upload-input-hasvalue + .upload-file {
  display: none;
}

.upload-input-hasvalue + .upload-file + .upload-submit {
  display: block;
}

.upload-form-controls {
  background: rgba(0, 0, 0, 0.8);
  border: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 10px;
  position: absolute;
  right: 0;
  z-index: 0;
}

.upload-form-controls button {
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  display: block;
  height: 42px;
  padding: 0;
  width: 42px;
}

.upload-form-controls-prev {
  background: rgba(255, 255, 255, 0.2) url('../img/icon-cross.png') center no-repeat;
  float: left;
}

.upload-form-controls-fwd {
  background: rgba(255, 231, 83, 0.2) url('../img/icon-arrow.png') center no-repeat;
  float: right;
}

.upload-resize canvas {
  cursor: move;
  left: 0;
  position: absolute;
  right: 0;
}

.upload-resize-controls {
  border: 0;
  bottom: 10px;
  color: #fff;
  font-size: 12px;
  left: 50%;
  line-height: 42px;
  margin: 0;
  margin-left: -235px;
  padding: 0;
  position: absolute;
  text-align: center;
  width: 470px;
  z-index: 1;
}

.upload-resize-controls input {
  border: none;
  border-radius: 2px;
  color: #000;
  font: 16px/1.3 'Open Sans';
  margin-left: 10px;
  margin-right: 20px;
  margin-top: -3px;
  padding: 0 3px;
  text-align: center;
  vertical-align: middle;
  width: 3em;
}

.upload-filter-controls {
  border: 0;
  bottom: 10px;
  color: #fff;
  font-size: 12px;
  left: 50%;
  line-height: 42px;
  margin: 0;
  margin-left: -235px;
  padding: 0;
  position: absolute;
  text-align: center;
  width: 470px;
  z-index: 1;
}

.upload-filter-controls input[type=radio] {
  position: absolute;
  visibility: hidden;
}

.upload-filter-label {
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font: bold 14px 'Open Sans Condensed';
  margin: 0 10px;
  text-transform: uppercase;
}

input[type=radio]:checked + .upload-filter-label {
  color: #ffe753;
}

.pictures {
  font-size: 0;
  margin: 0 auto;
  padding-left: 12px;
  text-align: left;
  width: 980px;
}

.pictures-loading:after,
.pictures-failure:after {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  box-sizing: border-box;
  color: #fff;
  font-size: 30px;
  margin-left: -100px;
  left: 50%;
  padding: 20px;
  position: absolute;
  text-align: center;
  top: 260px;
  width: 200px;
  z-index: 2;
}

.pictures-loading:after {
  content: 'Загрузка...';
}

.pictures-failure:after {
  content: 'Ошибка загрузки';
}

.picture {
  box-sizing: border-box;
  display: inline-block;
  height: 182px;
  margin-bottom: 14px;
  margin-right: 14px;
  overflow: hidden;
  position: relative;
  text-align: center;
  width: 182px;
}

.picture img {
  border: 0;
  height: 182px;
  margin-bottom: -34px;
}

.picture:nth-of-type(2n-1):nth-of-type(-n+6) {
  margin-right: 600px;
}

.picture-load-failure {
  background: url('../img/icon-cross.png') no-repeat center;
  border: solid 1px rgba(255, 255, 255, 0.2);
  opacity: 0.3;
  line-height: 182px;
}

.picture-load-failure img {
  display: none;
  height: 182px;
  width: 182px;
}

.picture-stats {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  color: #fff;
  display: none;
  line-height: 24px;
  padding: 0 10px;
}

.picture:hover .picture-stats {
  display: inline-block;
}

.picture-load-failure .picture-stats {
  line-height: 1.3;
  position: relative;
  top: -12px;
  vertical-align: bottom;
}

.picture-stat {
  font-size: 14px;
  font-weight: bold;
  margin: 0 5px;
  position: relative;
  vertical-align: middle;
}

.picture-stat:before {
  background: url('../img/image-icons-sprite.png') no-repeat 0 0;
  content: '';
  display: inline-block;
  margin: 0 2px;
  position: relative;
  top: -1px;
  vertical-align: middle;
}

.picture-comments:before {
  background-position: 0 0;
  height: 16px;
  width: 20px;
}

.picture-likes:before {
  background-position: -21px 0;
  height: 15px;
  width: 19px;
}

@media (min-width: 1380px) {
  .pictures {
    width: 1380px;
  }

  .picture:nth-of-type(2n-1):nth-of-type(-n+6) {
    margin-right: 14px;
  }

  .picture:nth-of-type(2),
  .picture:nth-of-type(6),
  .picture:nth-of-type(10) {
    margin-right: 602px;
  }
}

.gallery-overlay {
  background: rgba(0, 0, 0, 0.8);
  bottom: 0;
  left: 0;
  overflow: auto;
  position: fixed;
  right: 0;
  text-align: center;
  top: 0;
  z-index: 1;
}

.gallery-overlay-close {
  color: #fff;
  cursor: pointer;
  font-size: 45px;
  padding: 0 10px;
  position: absolute;
  right: 0;
  text-align: center;
  top: -5px;
}

.gallery-overlay-preview {
  background: #fff;
  margin: 30px 0;
  display: inline-block;
}

.gallery-overlay-image {
  border: solid 1px #ddd;
  display: block;
  cursor: pointer;
  height: 640px;
  width: 640px;
}

.gallery-overlay-controls {
  color: #000;
  font-size: 14px;
  font-weight: bold;
}

.gallery-overlay-controls-comments,
.gallery-overlay-controls-like {
  line-height: 40px;
  padding: 0 20px;
}

.gallery-overlay-controls-comments {
  margin-right: 150px;
  text-align: left;
}

.gallery-overlay-controls-like {
  float: right;
  text-align: right;
  width: 150px;
}

.likes-count {
  cursor: pointer;
}

.likes-count:before {
  background: url('../img/icon-heart-sprite.gif') no-repeat 0 0;
  content: '';
  cursor: pointer;
  display: inline-block;
  height: 15px;
  margin-right: 5px;
  vertical-align: middle;
  width: 18px;
}

.likes-count-liked:before {
  background-position: -18px;
}

.video {
  cursor: pointer;
}
