@import url(//at.alicdn.com/t/font_2615269_oxda8v6kl3.css);

html,
body {
  margin: 0;
  height: 100%;
  background: #f2f2f2;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input,
select {
  background: none;
  border: none;
  outline: none;
  display: black;
}

.main {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  max-width: 812px;
  border-radius: 10px;
  margin: auto;
  box-shadow: 0 0 0 5px #6D3F95, 0 0 0 20px #ccc;
  background: #6D3F95;
  height: 100%;
  max-height: 414px;
  padding: 10px;
}

.panel {
  position: relative;
  height: 100%;
  padding: 20px 20px 30px;
  box-sizing: border-box;
  background: #f8f1d7;
  border-radius: 15px;
  display: flex;
  flex-direction: row;
  box-shadow: inset 8px 8px #fffef7;
}

.function-area {
  flex: 1;
  display: flex;
  padding: 0 15px;
  justify-content: center;
  flex-direction: column;
}

.controller-area {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: row;
  margin-bottom: 15px;
}

.action-area {
  display: flex;
  flex-direction: row;
  margin-bottom: 40px;
}

.controller {
  position: relative;
  width: 140px;
  height: 140px;
  align-self: flex-end;
  filter: drop-shadow(5px 5px 0px rgba(255, 255, 255, .8));
}

.controller button {
  position: absolute;
  z-index: 1;
  border: 8px solid #999;
  /* background: #e5e3dd; */
  background: #e5e3dd;
  color: transparent;
  border-radius: 15px;
  box-sizing: border-box;
  outline: 0;
  width: 56px;
  height: 56px;
  left: 50%;
  top: 50%;
  user-select: none;
  transform: translate(-50%, -50%);
}


.controller::before {
  content: '';
  position: absolute;
  z-index: 0;
  pointer-events: none;
  box-sizing: border-box;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  background: #e5e3dd;
  transform: translate(-50%, -50%);
}

.controller::after {
  content: '';
  z-index: 2;
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  border: 8px solid #999;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0px 8px 0 0px #736a6d, inset 0px -8px 0 0px rgba(255, 255, 255, .4);
}

button.up.joydirection {
  top: 0;
  transform: translate(-50%, 0);
  border-bottom: 0;
  height: 50px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: inset 0px 8px 0 0px rgba(255, 255, 255, .5);
}

button.right.joydirection {
  left: auto;
  right: 0;
  transform: translate(0, -50%);
  border-left: 0;
  width: 50px;
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
  box-shadow: inset 8px 0 0 0px #e5e3dd, inset 6px 6px 0 0px rgba(255, 255, 255, .4), inset 8px -8px 0 0px rgba(0, 0, 0, .1);
}

button.down.joydirection {
  top: auto;
  transform: translate(-50%, 0);
  bottom: 0;
  border-top: 0;
  height: 50px;
  border-top-right-radius: 0;
  border-top-left-radius: 0;
  box-shadow: inset 0px -8px 0 0px rgba(0, 0, 0, .1);
}

button.left.joydirection {
  left: 0;
  transform: translate(0, -50%);
  border-right: 0;
  width: 50px;
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  box-shadow: inset 0px 8px 0 0px rgba(255, 255, 255, .4), inset -8px 0px 0 0px #e5e3dd, inset -8px -8px 0 0px rgba(0, 0, 0, .1);
}

.function {
  display: flex;
  padding: 8px 15px;
  border-radius: 50px;
  align-self: center;
  background: #6D3F95;
  box-shadow: 5px 5px 0 rgba(255, 255, 255, .8);
}

.function button {
  user-select: none;
  margin: 10px;
  height: 24px;
  width: 60px;
  outline: 0;
  border: 7px solid #999;
  box-shadow: 0 0 0 7px rgba(255, 255, 255, .1), inset 4px 4px 0 0px rgba(255, 255, 255, .4);
  background: #e5e3dd;
  color: transparent;
  border-radius: 15px;
  font-size: 12px;
}

.function button.active_btn {
  opacity: 0.7;
}

.action {
  display: flex;
  align-self: flex-end;
}

.action button {
  user-select: none;
  width: 56px;
  height: 56px;
  background: #e5e3dd;
  border-radius: 50%;
  outline: 0;
  color: transparent;
  border: 8px solid #999;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .6),
    inset 2px 5px 0 0px rgba(255, 255, 255, .2),
    inset -3px -6px 0 0px rgba(0, 0, 0, .1);
  transition: all 100ms;
}

.action button.active_btn {
  opacity: 0.9;
  box-shadow: 0 0 0 15px rgba(255, 255, 255, .5),
    inset 2px 5px 0 0px rgba(255, 255, 255, .2),
    inset -2px -5px 0 0px rgba(0, 0, 0, .1);
}

.action button:first-child {
  margin-right: 24px;
}


.function button,
.action button {
  /* color: #fff; */
  color: #6D3F95;
}

.function button {
  height: 32px;
  width: auto;
}

.sign {
  position: absolute;
  font-weight: bold;
  font-size: 20px;
  font-style: italic;
  height: 50px;
  right: 0;
  top: 0;
  background: #6D3F95;
  color: #f8f1d7;
  text-shadow: 0 -2px #fffef7;
  padding: 0 0 15px 15px;
  letter-spacing: 0.1em;
  border-bottom-left-radius: 15px;
  filter: drop-shadow(0 8px #fffef7)
}

.sign::before {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  left: -15px;
  top: 0;
  background: radial-gradient(circle at left bottom, transparent 14px, #6D3F95 15px);
}

.sign::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  bottom: -15px;
  right: 0;
  background: radial-gradient(circle at left bottom, transparent 14px, #6D3F95 15px);
}

.joy {
  position: absolute;
  left: 0;
  top: 0;
  width: 50px;
  height: 50px;
  background: #e5e3dd;
  border-radius: 5px;
  text-align: center;
  line-height: 50px;
  color: #f8f1d7;
  font-weight: bold;
  font-size: 30px;
}

.readme {
  position: absolute;
  left: 0;
  top: 90px;
  width: 90px;
  height: 30px;
  background: #e5e3dd;
  border-radius: 5px;
  text-align: center;
  line-height: 30px;
  color: #f8f1d7;
  font-weight: bold;
  font-size: 20px;
}

.screen {
  flex: 1;
  display: flex;
  width: 100%;
  transition: .3s;
  background: rgba(0, 0, 0, 1);
  margin-bottom: 5px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  position: relative;
}

.screen canvas {
  /* max-width: 100%;
  max-height: 100%; */
  border-radius: 8px;
  margin-top: 10px;
  max-height: 724px;
  height: auto;
  width: 100%;
  max-width: 431px;
}

.screen .tip,
.screen .qr-code {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.screen .tip p {
  width: 100%;
  text-align: center;
  font-size: 16px;
  color: #fff;
}

.screen .qr-code {
  background-color: #000;
}

.screen .qr-code img {
  margin: 0 auto;
  width: 180px;
}

.screen .qr-code p {
  color: #999;
  padding: 0 15px;
}

.nes-roms {
  margin-top: 10px;
}

.nes-roms>select {
  width: 200px;
}

.nes-controls {
  margin-top: 2px;
  margin-bottom: 10px;
}

@media screen and (orientation: portrait) {

  /*竖屏 css*/
  .main {
    max-height: 100%;
  }

  .function-area {
    position: absolute;
    left: 0;
    right: 0;
    top: 20px;
    /* bottom: 100px; */
    padding-bottom: 80px;
  }

  .function {
    position: absolute;
    bottom: 0;
    align-self: flex-end;
    /*transform: translateX(20px);*/
    padding: 8px 10px;
    /*border-radius: 50px 0 0 50px;*/
    box-shadow: 0px 5px 0 rgba(255, 255, 255, .8);
  }

  /*.function::before {*/
  /*  content: '';*/
  /*  position: absolute;*/
  /*  width: 15px;*/
  /*  height: 15px;*/
  /*  right: 0;*/
  /*  top: -15px;*/
  /*  background: radial-gradient(circle at left top, transparent 14px, #6D3F95 15px);*/
  /*}*/

  /*.function::after {*/
  /*  content: '';*/
  /*  position: absolute;*/
  /*  width: 15px;*/
  /*  height: 15px;*/
  /*  bottom: -15px;*/
  /*  right: 0;*/
  /*  background: radial-gradient(circle at left bottom, transparent 14px, #6D3F95 15px);*/
  /*}*/

  .screen {
    margin-bottom: 0;
  }

  .function button {
    /*width: 62px;*/
    margin: 10px;
  }

  .action-area {
    flex: 1;
    justify-content: flex-end;
  }

  .action button:first-child {
    margin-right: 20px
  }
}

/*横屏 css*/
@media screen and (orientation: landscape) {
  .function {
    position: absolute;
    bottom: 190px;
    right: 5px;
    align-self: flex-end;
    /*transform: translateX(20px);*/
    padding: 8px 10px;
    /*border-radius: 50px 0 0 50px;*/
    box-shadow: 0px 5px 0 rgba(255, 255, 255, .8);
  }

  .screen canvas {
    width: 380px;
  }

  .screen .icons {
    bottom: 230px;
    left: -150px;
  }

  .screen .nes-operation {
    bottom: 190px;
    left: -150px;
  }
}

.nes-root {
  position: relative;
}

.nes-operation {
  position: absolute;
  bottom: -100px;
  left: 0;
  z-index: 999;
  width: 120px;
  font-size: 12px;
}

/* 选择游戏 */
.nes-operation .nes-roms select {
  background: none;
  margin-bottom: 4px;
  height: 28px;
  margin-left: 3px;
  border: none;
  border-bottom: 1px solid #6D3F95;
  width: 100%;
  color: #6D3F95;
  border-radius: 0;
}

/* 重启等按钮 */
.nes-operation .nes-controls input {
  background: none;
  border: 1px solid #F4DEB3;
  margin: 2px;
  border-radius: 5px;
}

/* 图标 */
.icons {
  position: absolute;
  bottom: -60px;
  left: 0;
  width: 155px;
  height: 40px;
  padding-left: 5px;
  z-index: 999;
}

.icons .iconfont {
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  border: 1px solid #6D3F95;
  color: #6D3F95;
  display: block;
  text-align: center;
  float: left;
  margin-right: 10px;
}

.icons .iconfont.active-icon,
.icons .iconfont:active {
  /*margin-left: 10px;*/
  background: #6D3F95;
  border-color: #6D3F95;
  color: #f8f1d7;
  opacity: 0.8;
}

/* 链接 */
.link_btn {
  position: absolute;
  bottom: 35px;

  width: 100%;
  text-align: center;
  color: #6D3F95;
  text-decoration: none;
}

/* 版权 */
.copyright {
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #6D3F95;
  text-decoration: none;
}
