html,
body {
  width: 100%;
  height: 100%;
}

body {
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: url(images/main-back.jpg) no-repeat center bottom;
  background-size: cover;
}
@media (max-width: 767px) {
  body {
    margin: 0;
  }
}

#game-container {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
}

#game-container * {
  user-select: none;
}

#stack-images {
  position: absolute;
  right: 3%;
  width: 12%;
  top: 18%;
  height: 32%;
  background: url(images/match-back.png) no-repeat center;
  background-size: contain;
}

.stack-image {
  position: absolute;
  width: 70%;
  top: 15%;
  left: 15%;
  padding-top: 70%;
  transition: top 0.3s ease-in-out;
  background: url(images/cube.png) no-repeat center;
  background-size: contain;
}

.stack-image.time {
  background-image: url(images/cube-purple.png);
}

.stack-image .time-val {
  color: white;
  font-family: Helvetica, sans-serif;
  font-weight: 400;
  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  text-align: center;
  z-index: 2;
  font-size: 2.4vh;
}

.stack-image-side {
  position: absolute;
  overflow: hidden;
}
.stack-image-side.side-1 {
  top: 33%;
  left: -4%;
  width: 48%;
  height: 48%;
  transform: skew(0, 26deg) scaleX(0.6);
  filter: brightness(0.75);
}

.stack-image-side.side-2 {
  top: 33%;
  left: 46%;
  width: 52%;
  height: 52%;
  transform: skew(0, -12deg) scaleX(0.9);
  filter: brightness(0.92);
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .stack-image-side::before {
    position: absolute;
    content: '';
    background: black;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
  }
  .stack-image-side.side-1 img {
    opacity: 0.75;
  }
  .stack-image-side.side-2 img {
    opacity: 0.92;
  }
  .img-btn.disabled {
    opacity: 0.6;
  }
}

.stack-image img {
  width: 134%;
  margin: -17% -17% -20%;
}

.stack-image.stacked {
  top: 52%;
}

.fill-parent {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.btn-rotate {
  position: absolute;
  width: 10%;
  bottom: 2%;
}
.btn-rotate:hover {
  opacity: 0.6;
}

.btn-rotate.left {
  left: 5%;
}
.btn-rotate.right {
  right: 5%;
}

.top-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 8vw;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-bar-item {
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: white;
  font-size: 4vw;
}
.top-bar-item img {
  width: 5vw;
  height: auto;
}
.top-bar-item span {
  margin-left: 10%;
}
.time-holder {
  width: 15%;
}
.score-holder {
  margin-left: 5%;
  margin-right: 10%;
  width: 15%;
}
#left-time.red {
  color: red;
}
.top-bar-item.btn-holder {
  margin-left: 3%;
}
.top-bar-item .img-btn {
  cursor: pointer;
}
@media (max-width: 991px) {
  .top-bar {
    height: 11vw;
  }
  .top-bar-item img {
    width: 7vw;
  }
}
.img-btn:hover {
  filter: brightness(0.8);
}

.img-btn.disabled {
  filter: contrast(0.3);
  cursor: not-allowed;
}

.align-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn {
  pointer-events: all;
  cursor: pointer;
}

.game-overlay {
  pointer-events: none;
  position: fixed;
}

.black-overlay {
  pointer-events: all;
  background-color: rgba(0,0,0,0.4);
  display: none;
}

.game-loading .top-bar {
  display: none;
}
.game-loading .black-overlay,
.game-notify .black-overlay {
  display: block;
}
.game-loading #canvas {
  opacity: 0;
}
.game-loading .sk-fold {
  display: block;
}
.game-loaded .sk-fold {
  display: none;
}
.game-loading .btn {
  display: none;
}
.game-loading #stack-images {
  display: none;
}

/* start screen */
.start-view {
  top: 100vh;
  transition: all 0.4s ease-in-out;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
}
.start-view .game-title {
  width: 50%;
}
.start-view .btn-start {
  width: 15%;
  margin-top: 5%;
  display: block;
}
.game-loaded .start-view {
  top: 0;
  opacity: 1;
}

/* notification */
.notification {
  top: 100vh;
  transition: all 0.4s ease-in-out;
  flex-direction: column;
  opacity: 0;
}
.game-notify .notification {
  top: 0;
  opacity: 1;
}
.notification-img {
  width: 50%;
  margin-top: 10%;
}
.notification .img-btn {
  display: none;
  width: 24%;
}
.notification-box-wrapper {
  width: 60%;
}
.notification-box-wrapper-inner {
  width: 100%;
  padding-top: 51%;
  height: 0;
  position: relative;
}
.notification-box {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: url(images/text-box.png) no-repeat center;
  background-size: contain;
  display: flex;
  flex-direction: column;
}
.notification-box .text {
  font-size: 4vw;
  text-align: center;
  color: white;
  font-weight: 800;
  line-height: 1.1;
  flex: 1;
  padding-top: 7%;
}
.notification-box .btns-wrapper {
  display: flex;
}
.notification-box .btn {
  margin: 1% 3% 5%;
}
.game-over .notification .btn-play-again {
  display: block;
}
.game-paused .notification .btn-continue {
  display: inline-block;
}
.game-paused .notification .btn-how-to {
  display: inline-block;
}
.game-restart .notification .btn-restart {
  display: inline-block;
}
.game-restart .notification .btn-cancel {
  display: inline-block;
}

.explosion-wrapper {
  position: absolute;
  width: 20%;
  left: 0;
  top: 0;
  overflow: hidden;
  pointer-events: none;
}
.explosion {
  width: 100%;
  height: 0;
  padding-top: 100%;
  position: relative;
}
.explosion-inner {
  position: absolute;
  top: 0;
  width: 2000%;
  background: url(images/explode-map.png) no-repeat;
  background-position: 0 0;
  background-size: 100%;
  animation: explode 0.5s step-start 0s 1;
  height: 100%;
  opacity: 0;
}
@keyframes explode {
  0% {
    transform: translateX(-0%);
    opacity: 1;
  }
  5% {
    transform: translateX(-5%);
  }
  10% {
    transform: translateX(-10%);
  }
  15% {
    transform: translateX(-15%);
  }
  20% {
    transform: translateX(-20%);
  }
  25% {
    transform: translateX(-25%);
  }
  30% {
    transform: translateX(-30%);
  }
  35% {
    transform: translateX(-35%);
  }
  40% {
    transform: translateX(-40%);
  }
  45% {
    transform: translateX(-45%);
  }
  50% {
    transform: translateX(-50%);
  }
  55% {
    transform: translateX(-55%);
  }
  60% {
    transform: translateX(-60%);
  }
  65% {
    transform: translateX(-65%);
  }
  70% {
    transform: translateX(-70%);
  }
  75% {
    transform: translateX(-75%);
  }
  80% {
    transform: translateX(-80%);
  }
  85% {
    transform: translateX(-85%);
  }
  90% {
    transform: translateX(-90%);
  }
  95% {
    transform: translateX(-95%);
    opacity: 1;
  }
  99% {
    opacity: 0;
  }
}

.speed-match {
  position: absolute;
  width: 16%;
  height: 16%;
  left: 0;
  top: 0;
  overflow: hidden;
  pointer-events: none;
  background: url(images/speed-match.png) no-repeat center;
  background-size: contain;
  opacity: 0;
  animation: fade-up 0.6s linear 0s 1;
}
.speed-x {
  font-size: 2.4vw;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  color: white;
  text-shadow: 2px 2px 0 #FF6300,
              2px -2px 0 #FF6300,
              -2px -2px 0 #FF6300,
              -2px 2px 0 #FF6300;
  display: inline-block;
  margin-left: 53%;
  margin-top: 20%;
  line-height: 1;
}

.multi-match {
  position: absolute;
  width: 16%;
  height: 16%;
  left: 0;
  top: 0;
  overflow: hidden;
  pointer-events: none;
  background: url(images/multi-match.png) no-repeat center;
  background-size: contain;
  opacity: 0;
  animation: fade-up 0.6s linear 0s 1;
}
.multi-x {
  font-size: 2.4vw;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  color: white;
  text-shadow: 2px 2px 0 #CD05D1,
              2px -2px 0 #CD05D1,
              -2px -2px 0 #CD05D1,
              -2px 2px 0 #CD05D1;
  display: inline-block;
  margin-left: 53%;
  margin-top: 20%;
  line-height: 1;
}

.timer-match {
  position: absolute;
  width: 16%;
  height: 16%;
  left: 0;
  top: 0;
  overflow: hidden;
  pointer-events: none;
  background: url(images/time-bonus.png) no-repeat center;
  background-size: 90%;
  opacity: 0;
  animation: fade-up 0.6s linear 0s 1;
}
.timer-val {
  font-size: 2.6vw;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  color: white;
  text-shadow: 2px 2px 0 #b300ca,
              2px -2px 0 #b300ca,
              -2px -2px 0 #b300ca,
              -2px 2px 0 #b300ca;
  display: inline-block;
  margin-left: 30%;
  margin-top: 15%;
  line-height: 1;
  letter-spacing: 0.2vw;
}
@keyframes fade-up {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-70px);
    opacity: 0.7;
  }
  99% {
    transform: translateY(-140px);
    opacity: 0;
  }
}
.mute-holder:not(.muted) #btn-unmute {
  display: none;
}
.mute-holder.muted #btn-mute {
  display: none;
}

/* help */
.help {
  top: 100vh;
  transition: all 0.4s ease-in-out;
  opacity: 0;
}
.game-help .help {
  top: 0;
  opacity: 1;
}
.help-box {
  position: relative;
  padding-top: 46%;
  width: 65%;
  background: url(images/help-back.png) no-repeat left top;
  background-size: contain;
}
.help-box-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
.help-box-header {
  color: white;
  display: flex;
}
.help-box-content {
  padding-top: 4%;
}
.help-box-content img {
  width: 80%;
  margin-left: 10%;
  display: none;
}
.help-box-content img.active {
  display: block
}
.help-tab {
  padding: 1% 3%;
  font-size: 2vw;
  display: inline-block;
  border: .7vw solid white;
  background: rgba(0,0,0,0.1);
  cursor: pointer;
  pointer-events: all;
  word-break: keep-all;
  white-space: nowrap;
}
.help-tab:nth-child(1n + 2) {
  margin-left: -0.7vw;
}
.help-tab.active {
  border-bottom-width: 0;
  background: none;
}
.checkbox {
  font-size: 1.4vw;
  padding: 2% 2% 2% 5%;
  cursor: pointer;
  pointer-events: all;
  position: relative;
}
.checkbox::before {
  content: '';
  width: 1.6vw;
  height: 1.6vw;
  border: 0.2vw solid white;
  position: absolute;
  left: 4%;
  top: 21%;
}
.checkbox.checked::after {
  content: '';
  width: 1vw;
  height: 0.6vw;
  border: solid white;
  border-width: 0 0 0.2vw 0.2vw;
  transform: rotate(-45deg);
  position: absolute;
  left: 6%;
  top: 27%;
}
.help-box .btn {
  display: inline-block;
  width: 20%;
  margin-top: 2%;
}