
#demo {
  background: #242;
}
.tile {
  /* font-family: serif; */
  font-family: "游明朝","Yu Mincho",YuMincho,"Hiragino Mincho ProN","Hiragino Mincho Pro","HGS明朝E",メイリオ,Meiryo,serif;
  font-weight: bold;
  box-sizing: border-box;
  width: 1.5em;
  height: 2em;
  line-height: 2em;
  text-align: center;
  background: #f8f8f8;
  border-radius: 0.125em;
  border: 1px solid #999;
  position: relative;
  box-shadow: 0.1em 0.1em 0px 0px #999, 0.2em 0.2em 0px 0px #963;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  color: #333;
  padding-left: 2px;
  text-shadow: -1px 0px 0px #000, 1px 1px 0px #fff;
  transition: border-color 0.05s linear, box-shadow 0.05s linear;
  transition: visibility 0.1s linear, opacity 0.1s linear;
}
.tile.selected {
  border-color: red;
  box-shadow: 0px 0px 2px 2px #f33,
    0.1em 0.1em 0px 0px #999,
    0.2em 0.2em 0px 0px #963;
}
.tile:after,.tile:before {
  position:absolute;
  content: '';
  width: 0.2em;
  height: 0.2em;
  background: #963;
  z-index: -1;
  transition: visibility 0.1s step-end, opacity 0.1s step-end;
}
.tile:after {
  top:-1px;right:0;
  transform-origin: top right;
  transform: scale(1.4) rotate(-45deg);
}
.tile:before {
  bottom:0;left:-1px;
  transform-origin: bottom left;
  transform: scale(1.4) rotate(45deg);
}
.view {
  font-size: 125%;
  position: relative;
  pointer-events: none;
  margin: 0 auto;
  padding-bottom: 2em;
  width: 24em;
  transform-origin:50% 0%;
  top:0;
  left:0;
}
.view > div {
  display: block;
}
.view > div:not(:first-child) { position:absolute;top:0;left:0; }
.view > div:nth-child(4) { transform: translate(0.25em, 0.25em); }
.view > div:nth-child(3) { transform: translate(0.5em, 0.5em); }
.view > div:nth-child(2) { transform: translate(0.75em, 0.75em); }
.view > div:nth-child(1) { transform: translate(1em, 1em); }
.view > div > div {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  height: 1em;
}
.view > div > div > div {
  flex-shrink: 0;
  display: inline-block;
  width: 0.75em;
  height: 1em;
  overflow: visible;
}
.tile.none {
  box-shadow: none;
  visibility: hidden;
  opacity: 0;
}
.tile.none:after,
.tile.none:before {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.1s step-start, opacity 0.1s step-start;
}
#demo p {
  text-align: center;
  font: bold 1.5rem serif;
  margin: 0;
  color: white;
}

.buttons{
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
}
button {
  font: bold 1rem serif;
  color: white;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s ease-in;
  margin: 0 1em;
  padding: 0.25em 0.5em;
}
button:hover, button:active {
  border-color: white;
}


