@charset "UTF-8";

:root {
  --vivant-color-primary: #D71718;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
}

#header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  width: 100vw;
  height: 80px;
  padding: 0 1em;
  background-color: #00000099;
  p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--vivant-color-primary);
  }
}

#chart-area {
  width: 100vw;
  height: 100vh;
}

#chart-navigation {
  position: fixed;
  z-index: 100;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template: auto / auto 1fr auto;
  align-items: center;
  width: 100vw;
  height: 48px;
  padding: 0 1em;
  background-color: #00000099;
  /* 初期表示 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s;
  /* */
  h1 {
    font-size: clamp(2rem, 2vw, 3rem);
    font-weight: 700;
    color: var(--vivant-color-primary);
    line-height: 1;
    font-family: "anton", sans-serif;
    font-weight: 400;
    font-style: normal;
  }
  .buttons {
    display: flex;
    align-items: center;
    grid-gap: .5em;
    button {
      display: block;
      appearance: none;
      border: none;
      outline: none;
      background-color: #222;
      color: #fff;
      font-size: clamp(1rem, 1vw, 1.5rem);
      line-height: 2.5;
      padding: 0 .8em;
      cursor: pointer;
      touch-action: manipulation;
      user-select: none;
      -webkit-user-select: none;
      transition: color .15s;
      justify-content: center;
      &.disabled {
        color: #000;
        pointer-events: none;
        cursor: default;
      }
    }
  }
}
body.is-chart-ready #chart-navigation {
  opacity: 1;
  visibility: visible;
}
/* height 100vh を保つために上書き */
.is-chart-ready #menu_new {
  position: fixed !important;
}

#sp_menu {
  position: fixed !important;
}

.buttons.change-file {
  position: relative;
  justify-content: center;
  button {
    background-color: transparent;
    padding: 0;
    line-height: 1;
  }
  #changeFileBack,
  #changeFileForward {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    background-color: transparent;
    &::before {
      content: '';
      position: absolute;
      inset: 0;
      background: url('../img/arrow.svg') no-repeat center / 26px 26px;
    }
    /* タップ領域を #changeFile の半分まで延長 */
    &::after {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      height: 48px;
    }
    &:disabled {
      cursor: default;
      pointer-events: none;
      &::before {
        background-image: url('../img/arrow_disable.svg');
        background-size: 18px 18px;
      }
    }
  }
  #changeFileBack::after {
    left: 100%;
    width: calc(80px + 0.5em); /* gap + #changeFile(160px)の半分 */
  }
  #changeFileForward::before {
    transform: scaleX(-1);
  }
  #changeFileForward::after {
    right: 100%;
    width: calc(80px + 0.5em); /* #changeFile(160px)の半分 + gap */
  }
  #changeFile {
    height: 32px;
    width: 160px;
    background: no-repeat center center / contain;
    pointer-events: none;
  }
}

@media (max-width: 768px) {
  #chart-navigation {
    /**/
    .change-file {
      position: absolute;
      left: 50%;
      top: -6px;
      transform: translateX(-50%) translateY(-100%);
      background: rgba(0, 0, 0, 0.7);
      box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
      max-height: 32px;
      padding: 4px;
      #changeFile {
        width: 140px;
      }
      #changeFileBack::after,
      #changeFileForward::after {
        width: calc(70px + 0.5em); /* gap + #changeFile(140px)の半分 */
        height: 32px;
      }
    }
    .buttons {
      justify-content: right;
    }
  }
}