/*----------------------------------------
 main.css
----------------------------------------*/
html {
  position: relative;
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-family: 'Avenir','ヒラギノ角ゴ W3', 'メイリオ', 'ＭＳ Ｐゴシック', sans-serif;
  letter-spacing: 1.1px;
  color: #333;
  background-color: #ddd;
}

section {
  max-width: 500px;
  padding-top: 70px;
  margin: 0 auto;
  background-color: #fff;
}

header {
  position: fixed;
  top: 0;
  display: block;
  width: 100%;
  max-width: 500px;
  height: 70px;
  padding: 15px 0;
  text-align: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e5e5e5;
  box-sizing: border-box;
  z-index: 2;
}

header h1 {
  font-size: 15px;
  font-weight: bold;
  color: #333;
}

header div {
  display: block;
  margin-top: 7px;
}

header span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  background-color: #ccc;
  font-size: 10px;
  color: #fff;
}

header span[data-is-active='true'] {
  background-color: #6ed980;
  animation-name: flash;
  animation-duration: 2.5s;
  animation-iteration-count: infinite;
  animation-direction: reverse;
  animation-play-state: running;
}

@keyframes flash {
  50% {
    background-color: #2fb245;
  }
}

/*---------- graph ----------*/
#graph {
  display: none;
}

#graph h2 {
  position: sticky;
  top: 70px;
  padding: 10px 20px;
  background: #eee;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e5e5e5;
  font-weight: bold;
  font-size: 14px;
  z-index: 1;
}

#graph > div {
  position: relative;
}

#graph > div:before {
  content: "";
  position: absolute;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0;
}

#graph canvas {
  height: 200px;
  min-height: 200px;
}

/*---------- table ----------*/
#table {
  display: inherit;
}

#table h2 {
  position: sticky;
  top: 70px;
  padding: 10px 20px;
  background: #eee;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e5e5e5;
  font-weight: bold;
  font-size: 14px;
  z-index: 1;
}

#table table {
  table-layout: fixed;
  width: 100%;
}

#table table td:first-child {
  width: 60%;
  padding: 20px;
  border-bottom: 1px dotted #d5d5d5;
  text-align: left;
}

#table table td:last-child {
  width: 40%;
  padding: 20px;
  border-bottom: 1px dotted #d5d5d5;
  text-align: right;
  font-weight: bold;
}

/*---------- button ----------*/
#button {
  position: fixed;
  bottom: 0;
  display: none;
  width: 100%;
  max-width: 500px;
  padding: 50px 20px 20px 20px;
  box-sizing: border-box;
  background: linear-gradient(0deg, rgba(255, 255, 255, 1.0), rgba(255, 255, 255, 0.5));
}

#button button {
  display: block;
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  line-height: 1;
  letter-spacing: 1.1px;
  color: #fff;
}

#button button:focus {
  outline: 0;
}

#button button + button {
  margin-top: 10px;
}

#button button[name='showAllData'] {
  display: inherit;
  background-color: #6ed980;
  box-shadow: 0 2px 0 #2fb245;
}
#button button[name='showPartData'] {
  display: inherit;
  background-color: #6ed980;
  box-shadow: 0 2px 0 #2fb245;
}
#button button[name='downloadData'] {
  display: none;
  display: inherit;
  background-color: #bbb;
  box-shadow: 0 2px 0 #888;
}
#button button[name='shareQRCode'] {
  display: none;
  display: inherit;
  background-color: #bbb;
  box-shadow: 0 2px 0 #888;
}

#button[data-is-firstView='false'] button[name='showAllData']{
  display: none;
}
#button[data-is-firstView='true'] button[name='showPartData']{
  display: none;
}
#button[data-is-firstView='true'] button[name='downloadData']{
  display: none;
}
#button[data-is-firstView='true'] button[name='shareQRCode']{
  display: none;
}

/*---------- modal ----------*/
#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  display: none;
  width: 80vw;
  max-width: 320px;
  background-color: #fff;
  -webkit-filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.15));
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.15));
  padding: 30px;
  box-sizing: border-box;
  border-radius: 12px;
  transform: translate(-50%, -50%);
  z-index: 3;
}

#modal img {
  display: block;
  width: 100%;
}

#modal p {
  text-align: center;
  letter-spacing: 1.1px;
  line-height: 1.5;
  font-size: 14px;
  color: #333;
}

#modal button {
  margin-top: 40px;
  display: block;
  width: 100%;
  padding: 20px;
  background-color: #6ed980;
  border: none;
  border-radius: 6px;
  box-shadow: 0 2px 0 #2fb245;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  line-height: 1;
  letter-spacing: 1.1px;
  color: #fff;
}

/*---------- layer ----------*/
#layer {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  opacity: 0.4;
  z-index: 2;
}

/*---------- loading ----------*/
#loading {
  position: absolute;
  top: calc(50% - 220px / 2);
  display: block;
  width: 100%;
  max-width: 500px;
}

#loading:before {
  position: relative;
  content: '';
  display: block;
  width: 1em;
  height: 1em;
  margin: 100px auto;
  border-radius: 50%;
  font-size: 20px;
  text-indent: -9999em;
  color: #fff;
  -webkit-animation: load 1.3s infinite linear;
  animation: load 1.3s infinite linear;
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
}

@-webkit-keyframes load {
  0%,
  100% {
    box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0;
  }
  12.5% {
    box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
  }
  25% {
    box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
  }
  37.5% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
  }
  50% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
  }
  62.5% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
  }
  75% {
    box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
  }
  87.5% {
    box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
  }
}
@keyframes load {
  0%,
  100% {
    box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0;
  }
  12.5% {
    box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
  }
  25% {
    box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
  }
  37.5% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
  }
  50% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
  }
  62.5% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
  }
  75% {
    box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
  }
  87.5% {
    box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
  }
}
