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

html {
  height: 100%;
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  /* 標準設定では幅400〜1000pxの間を、従来の70〜100%で連続的に拡縮。 */
  font-size: clamp(0.7em, calc(0.5em + 0.8vw), 1em);
}

body {
  background: #111;
  height: 100%;
  overflow: hidden;
  font-size: 1.5em;
}

#main {
  color: #f1f1f1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  text-align: center;
}

.bar {
  position: relative;
  width: 20%;
  height: 0%;
  isolation: isolate;
  will-change: height;
}

#month { background: #093462; }
#date { background: #0c4887; }
#hour { background: #0f5bac; }
#minute { background: #136fd1; }
#second { background: #1682f6; }

.per,
.per-diff {
  font-family: "M PLUS 1 Code", monospace;
  position: absolute;
  left: 5px;
  line-height: 1em;
}

.per {
  top: 5px;
}

.per-diff {
  top: calc(-1em - 5px);
  opacity: 0.3;
}

.data {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
}

.label {
  font-weight: 300;
}

.time {
  font-size: 2.7em;
  margin: 10px 0;
  font-weight: 700;
}

.mini {
  font-size: 1.5em;
}

@media screen and (max-width: 1400px) {
  .data {
    bottom: 80px;
  }

  .per {
    top: inherit;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media screen and (max-width: 700px) {
  .per-diff {
    left: 50%;
    transform: translateX(-50%);
  }
}

.bar::before {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: inherit;
  opacity: 0;
  pointer-events: none;
}

.bar > * {
  z-index: 1;
}

.bar.is-resetting::before {
  animation: bar-rollover-fade 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes bar-rollover-fade {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bar.is-resetting::before {
    animation-duration: 1ms;
  }
}
