
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: none;
}

body {
  background: #f9f8f1 url('../img/game-bg.png') center center;
  font-family: 'Chathura', sans-serif;
  color: #212121;
  font-size: 16px;
  position: relative;
}

h1, h2 {
  font-family: 'Amatica SC', cursive;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 3em;
  line-height: 2em;
  font-weight: bold;
  position: relative;
}

h3 {
  font-size: 2em;
  font-weight: normal;
}

h4 {
  font-size: 0.9em;
  line-height: 1em;
  text-align: left;
  letter-spacing: 2px;
  text-transform: uppercase;
}

p {
  text-align: center;
}

a {
  font-family: inherit;
  color: inherit;
  text-decoration: none;
}

ul, ol {
  margin: 0.25em 0 0.5em;
  text-align: left;
  list-style: none;
  padding: 0;
}


#page {
  width: 100%;
  height: 100%;
  margin: auto;
  position: relative;
}
#page[data-size="8"] {
  width: 600px;
}
#page[data-size="7"] {
  width: 530px;
}
#page[data-size="6"] {
  width: 462px;
}
#page[data-size="5"] {
  width: 392px;
}

div[class*="wrap-"] {
  padding: 6px 12px;
  font-size: 2em;
  line-height: 1;
  user-select: none !important;
  -moz-user-select: none !important;
  -khtml-user-select: none !important;
  -webkit-user-select: none !important;
}

.wraps {
  margin: 0 auto;
}

div.wrap-game {
  padding: 0 8px;
  position: relative;
}
  .wrap-game:before,
  .wrap-game:after {
    content: " ";
    width: 6px;
    height: 40%;
    position: absolute;
    top: 30%;
  }
  .wrap-game:before {
    background: #FF8A65;
    left: 0;
  }
  .wrap-game:after {
    background: #AED581;
    right: 0;
  }

.wrap-score {
  margin-bottom: -44px;
}
  .wrap-score #score {
    position: relative;
  }
    .wrap-score #score > i {
      width: 28px;
      text-align: center;
      position: absolute;
      top: 5px;
      right: -36px;
      font-size: 0.6em;
      line-height: 0.8em;
      font-weight: bolder;
      font-style: normal;
      color: #212121;
      letter-spacing: 1px;
      border-radius: 12px 0;
      border: 2px solid #ff8a65;
    }
  .wrap-score #score,
  .wrap-step #step {
    font-weight: bold;
  }

.wrap-navs {
  text-align: right;
}
  .wrap-navs a#restart {
    padding: 0 10px;
    margin-right: -10px;
    display: inline-block;
  }

.wrap-step {
  text-align: right;
}


#game {
  width: 100%;
  padding: 8px 0;
}
  #game:before,
  #game:after {
    content: " ";
    width: 40%;
    height: 6px;
    position: absolute;
    left: 30%;
  }
  #game:before {
    background: #FFE082;
    top: 0;
  }
  #game:after {
    background: #81D4FA;
    bottom: 0;
  }
  #game table {
    width: 100%;
    margin: 0 auto;
    border-spacing: 4px !important;
  }
    #game table td {
      width: 10%;
      height: auto;
      padding: 0;
      border: 1px solid #d9d7ca;
      text-align: center;
      position: relative;
      box-sizing: border-box;
    }
    #game table td:before {
      content: "";
      display: block;
      padding-top: 100%;
    }
      #game table td > span {
        padding: 2px;
        font-size: 0.5em;
        line-height: 0.5em;
        position: absolute;
        z-index: 200;
        top: 4px;
        right: 4px;
        display: block;
      }
      #game table td > div {
        width: 100%;
        height: 100%;
        overflow: hidden;
        color: #212121;
        letter-spacing: 0;
        font-style: normal;
        font-family: 'Comfortaa', sans-serif;
        color: white;
        font-weight: bold;
        text-shadow: 1px 1px 4px #646464;
        font-size: 2em;
        line-height: 1.2em;
        text-indent: 0;
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
      }
      #game table td[data-digit^="2"] > div {
        text-indent: -2px;
        letter-spacing: -4px;
      }
      #game table td[data-digit^="3"] > div {
        text-indent: -6px;
        letter-spacing: -4px;
        font-size: 1.6em;
        line-height: 1.4em;
      }
      #game table td[data-combo] > div:before,
      #game table td[data-combo] > div:after,
      #message:before {
        content: " ";
        width: 100%;
        height: 100%;
        opacity: 0.1;
        background: repeating-linear-gradient( 0deg, #000000, #000000 0px, transparent, transparent 4px );
        border-radius: 0 100% 0 0;
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
      }
      #game table td[data-combo] > div:after,
      #message:after {
        background: repeating-linear-gradient( 90deg, #000000, #000000 0px, transparent, transparent 4px );
        border-right: 1px solid black;
      }
      #game table td[data-combo="1"] > div:before,
      #game table td[data-combo="1"] > div:after {
        width: 20%;
        height: 20%;
      }
      #game table td[data-combo="2"] > div:before,
      #game table td[data-combo="2"] > div:after {
        width: 60%;
        height: 60%;
      }
      #game table td[data-combo] {
        border-color: rgba(0, 0, 0, .1);
      }
      #game table td[data-combo][data-status="1"] > div:before,
      #game table td[data-combo][data-status="1"] > div:after {
        width: 100%;
        height: 100%;
        border-right: 0;
        border-radius: 0;
      }

#message {
  width: 100%;
  height: 100%;
  padding: 15%;
  font-style: normal;
  font-size: 48px;
  line-height: 36px;
  text-align: center;
  overflow: visible;
  position: absolute;
  top: 0;
  bottom: auto;
  left: 0;
  box-sizing: border-box;
  display: none;
}
  #message:before {
    border-radius: 0;
  }
  #message:before {
    height: 40%;
    top: 30%;
    left: 0;
  }
  #message > div {
    padding: 0 10%;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translate(0, -50%);
  }

#modal {
  width: 100%;
  height: 100%;
  padding: 10%;
  background: #212121;
  font-style: normal;
  font-size: 48px;
  line-height: 36px;
  text-align: center;
  color: #eeede6;
  opacity: 0.8;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
}
#modal.hide {
  width: auto;
  height: auto;
  padding: 0;
  left: auto;
  bottom: auto;
}
  #modal > div {
    max-width: 640px;
    margin: 0 auto;
  }
  #modal.hide > div {
    display: none;
  }
  #modal .modal-action {
    padding: 5px 20px;
    display: inline-block;
  }
    #modal .modal-action[data-action="show"] {
      font-size: 36px;
    }
    #modal:not(.hide) .modal-action[data-action="show"] {
      display: none;
    }
    #modal .modal-action[data-action="hide"] {
      color: #f2501d;
      font-size: 64px;
      font-weight: bold;
      position: absolute;
      top: 0;
      right: 0;
    }
    #modal.hide .modal-action[data-action="hide"] {
      display: none;
    }
  #modal p {
    margin: 0;
    font-size: 40px;
    text-align: left;
    text-indent: 20px;
    position: relative;
  }
  #modal p:before {
    content: "#";
    color: #888eff;
    opacity: 0.5;
    position: absolute;
    top: 2px;
    left: -25px;
  }
  #modal p + h4 {
    margin-top: 20px;
  }
  #modal h4 {
    margin: 0;
  }

.copyright {
  font-size: 2em;
  line-height: 1.5em;
  text-align: center;
  position: absolute;
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
}

@media only screen and (max-width: 640px) {
  h1 {
    font-size: 2.4em;
    line-height: 2em;
  }
  .wraps {
    max-width: 480px;
  }
  div.wrap-navs {
    margin-bottom: 0;
  }
  #game table td > div {
    font-size: 1.8em;
    line-height: 1em;
  }
  .copyright {
    padding: 0;
  }

}

@media only screen and (max-width: 480px) {
  h1 {
    line-height: 1.4em;
  }

  #page, #page[data-size] {
    width: auto;
  }
  #modal .modal-action {
    padding: 2px 12px;
  }
}

@media only screen and (max-width: 360px) {
  #modal h4 {
    font-size: 0.8em;
  }
  #modal p {
    font-size: 34px;
    line-height: 0.9em;
  }
}

@viewport {
    orientation: portrait;
}
