:root {
  color: #ccc;
  background-color: #000;
}

body {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  display: flex;
  overflow: hidden;
}

@font-face {
  font-family: square-sans;
  src: url("/square-sans.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

#app .clock {
  aspect-ratio: 6;
  width: 1040px;
  max-width: min(1040px, 96vw);
  margin: 0 auto;
  display: inline-block;
  container-type: inline-size;
}

#app .clock > .container {
  justify-content: center;
  align-items: center;
  gap: 3cqw;
  display: flex;
}

#app .clock > .container :is(.hours, .minutes, .seconds) {
  background-color: rgba(0, 0, 0, .25);
  min-width: 31cqw;
  height: 15cqw;
  position: relative;
  left: 1cqw;
  overflow: hidden;
  box-shadow: inset 0 0 19px -1px rgba(0, 0, 0, .65);
}

#app .clock > .container :is(.hours, .minutes, .seconds) > .container {
  transform: translateY(-50%);
}

#app .clock > .container :is(.hours, .minutes, .seconds) > .container.flipped {
  transform: translateY(0);
}

#app .clock > .container :is(.hours, .minutes, .seconds) > .container > span {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  align-content: center;
  justify-content: center;
  font-family: square-sans;
  font-size: 19cqw;
  line-height: 15cqw;
  display: grid;
}

@media screen and (orientation: portrait) {
  #app .clock {
    aspect-ratio: unset;
    width: 340px;
    min-width: min(340px, 96vw);
  }

  #app .clock > .container {
    flex-direction: column;
    height: auto;
  }

  #app .clock > .container :is(.hours, .minutes, .seconds) {
    height: 46cqw;
  }

  #app .clock > .container :is(.hours, .minutes, .seconds) > .container {
    position: relative;
    left: 3.5cqw;
  }

  #app .clock > .container :is(.hours, .minutes, .seconds) > .container span {
    font-size: 54cqw;
    line-height: 46cqw;
  }
}
