@import "../../css/reset.css";

html {
  background-color: #EDE9E6;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 760px;
  height: 760px;
  background-color: #B6A8A0;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  border-radius: 2%;
}

ul {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 2.25%;
}

li {
  position: relative;
  width: 0;
  height: 0;
  padding: 11.5%;
  background-color: #C9BCB4;
  border-radius: 6%;
  user-select: none;
  color: #e8e4e6;
}

li div {
  position: absolute;
  width: 0;
  height: 0;
  padding: 50%;
  left: 0;
  top: 0;
  border-radius: 6%;
}

li div b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.item-0 {
  font-size: 0;
}

.item-2 {
  font-size: 96px;
  color: #001e1d;
  background-color: #E3DBD0;
}

.item-4 {
  font-size: 96px;
  color: #001e1d;
  background-color: #E3D8C4;
}

.item-8 {
  font-size: 96px;
  background-color: #E8B387;
}

.item-16 {
  font-size: 80px;
  background-color: #EAA07B;
}

.item-32 {
  font-size: 80px;
  background-color: #EA8C73;
}

.item-64 {
  font-size: 80px;
  background-color: #E77757;
}

.item-128 {
  font-size: 64px;
  background-color: #E3CB83;
}

.item-256 {
  font-size: 64px;
  background-color: #E3CA78;
}

.item-512 {
  font-size: 64px;
  background-color: #E4C568;
}

.item-1024 {
  font-size: 56px;
  background-color: #E4C35A;
}

.item-2048 {
  font-size: 56px;
  background-color: #E2C14E;
}

.operate-panel,
.popup-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, .8);
}

.operate-panel.active,
.popup-panel.active {
  display: block;
}

.btn-back,
.btn-rule,
.btn-coder,
.btn-more {
  color: #EDE9E6;
  position: absolute;
  right: 1rem;
  bottom: 2rem;
  width: 0;
  height: 0;
  padding: 30px;
  border-radius: 50%;
  transition: all .25s;
  transition-duration: .25s;
  transition-timing-function: ease-in-out;
  cursor: pointer;
}

.btn-back:after,
.btn-rule:after,
.btn-coder:after {
  content: attr(value);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.btn-back {
  background-color: #d8330a;
  transition-delay: .05s;
}

.btn-back.active {
  right: 9rem;
  bottom: 2rem;
}

.btn-rule {
  background-color: #a77a1b;
  transition-delay: .1s;
}

.btn-rule.active {
  right: 6.657rem;
  bottom: 7.657rem;
}

.btn-coder {
  background-color: #8b8d19;
  transition-delay: .15s;
}

.btn-coder.active {
  right: 1rem;
  bottom: 10rem;
}

.btn-more {
  background-color: #078881;
}

.btn-more.active {
  background-color: #14b9b1;
}

.btn-more:before,
.btn-more:after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 5%;
  background-color: currentColor;
  transition: all .25s;
}

.btn-more:before {
  -webkit-transform: translate(-50%, -50%) rotate(0deg);
  transform: translate(-50%, -50%) rotate(0deg);
}

.btn-more:after {
  -webkit-transform: translate(-50%, -50%) rotate(90deg);
  transform: translate(-50%, -50%) rotate(90deg);
}

.btn-more.active:before {
  -webkit-transform: translate(-50%, -50%) rotate(45deg);
  transform: translate(-50%, -50%) rotate(45deg);
}

.btn-more.active:after {
  -webkit-transform: translate(-50%, -50%) rotate(135deg);
  transform: translate(-50%, -50%) rotate(135deg);
}

.popup {
  display: none;
  position: absolute;
  left: 16%;
  right: 16%;
  top: 50%;
  max-width: 320px;
  text-align: center;
  padding: .5em 1em;
  margin: auto;
  border-radius: 1rem;
  background-color: #e8e4e6;
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
}

.popup.active {
  display: block;
}

.popup h1 {
  margin: 0;
  line-height: 2;
}

.popup div {
  max-height: 300px;
  overflow-y: auto;
}

.popup p {
  text-align: justify;
  width: fit-content;
  margin: auto;
  line-height: 2;
}

.popup .btn-close {
  width: 2.4em;
  height: 2.4em;
  box-sizing: border-box;
  text-indent: -9999px;
  vertical-align: middle;
  position: absolute;
  bottom: 100%;
  left: 100%;
  color: #e8e4e6;
  cursor: pointer;
}

.popup .btn-close:before,
.popup .btn-close:after {
  content: '';
  box-sizing: inherit;
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.popup .btn-close:before {
  width: 90%;
  border-top: 2px solid;
  -webkit-transform: translate(-50%, -50%) rotate(45deg);
  transform: translate(-50%, -50%) rotate(45deg);
}
.popup .btn-close:after {
  height: 90%;
  border-left: 2px solid;
  -webkit-transform: translate(-50%, -50%) rotate(45deg);
  transform: translate(-50%, -50%) rotate(45deg);
}

@-webkit-keyframes emerge {
  from {
    -webkit-transform: scale(.1);
  }
  to {
    -webkit-transform: scale(1);
  }
}

@keyframes emerge {
  from {
    transform: scale(.1);
  }
  to {
    transform: scale(1);
  }
}

.item-emerge {
  -webkit-transform: scale(.1);
  transform: scale(.1);
  -webkit-animation: emerge .35s ease-in-out forwards;
  animation: emerge .35s ease-in-out forwards;
}

@media screen and (max-width: 750px) {
  .container {
    width: 0;
    height: 0;
    padding: 48%;
  }
  
  .item-2 {
    font-size: 12vw;
  }
  
  .item-4 {
    font-size: 12vw;
  }
  
  .item-8 {
    font-size: 12vw;
  }
  
  .item-16 {
    font-size: 10vw;
  }
  
  .item-32 {
    font-size: 10vw;
  }
  
  .item-64 {
    font-size: 10vw;
  }
  
  .item-128 {
    font-size: 8vw;
  }
  
  .item-256 {
    font-size: 8vw;
  }
  
  .item-512 {
    font-size: 8vw;
  }
  
  .item-1024 {
    font-size: 7vw;
  }
  
  .item-2048 {
    font-size: 7vw;
  }
}

@media (orientation: landscape) {
  .container {
    width: 96vh;
    height: 96vh;
    padding: 0;
  }
  
  .item-2 {
    font-size: 12vh;
  }
  
  .item-4 {
    font-size: 12vh;
  }
  
  .item-8 {
    font-size: 12vh;
  }
  
  .item-16 {
    font-size: 10vh;
  }
  
  .item-32 {
    font-size: 10vh;
  }
  
  .item-64 {
    font-size: 10vh;
  }
  
  .item-128 {
    font-size: 8vh;
  }
  
  .item-256 {
    font-size: 8vh;
  }
  
  .item-512 {
    font-size: 8vh;
  }
  
  .item-1024 {
    font-size: 7vh;
  }
  
  .item-2048 {
    font-size: 7vh;
  }
}