@property --x {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.tp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.tp__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 12px);
  color: #17141a;
}

.tp__ico {
  width: 16px;
  height: 16px;
  color: #2f6df6;
}

.tp__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  background: #f4f1ea;
  border: 1px solid rgba(23, 20, 26, 0.12);
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.tp__label {
  margin: 0;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 12px);
  color: #17141a;
}

.tp__wave {
  position: relative;
  width: 100%;
  height: 64px;
}

.tp__row {
  display: grid;
  grid-template-rows: 1fr;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  align-items: end;
  height: 100%;
}

.tp__bar {
  display: block;
  border-radius: 4px;
  height: calc(var(--h, 0.3) * 100%);
  transform-origin: bottom center;
}

.tp__row--base .tp__bar {
  background: rgba(23, 20, 26, 0.18);
}

.tp__lit {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
}

.tp__row--lit .tp__bar {
  background: linear-gradient(180deg, #4cd4a6 0%, #2f6df6 100%);
}

.tp__head {
  position: absolute;
  left: calc(var(--x, 0%));
  top: -4px;
  bottom: -4px;
  width: 4px;
  margin-left: -2px;
  border-radius: 999px;
  background: #ff4d1f;
}

.tp__time {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 12px);
  color: #17141a;
}

.tp__now {
  font-weight: 800;
  color: #0a4fe8;
}

.tp__sep {
  color: rgba(23, 20, 26, 0.72);
}

.tp__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tp__play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: #2f6df6;
  color: #ffffff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1;
}

.tp__ico--pause {
  display: none;
}

.tp__play[aria-pressed=true] .tp__ico--play {
  display: none;
}

.tp__play[aria-pressed=true] .tp__ico--pause {
  display: inline-block;
}

.tp__play .tp__ico {
  color: #ffffff;
}

.tp.is-demo .tp__lit {
  animation-name: tpFillLoop;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes tpFillLoop {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  86% {
    clip-path: inset(0 8% 0 0);
  }
  90% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}
.tp.is-demo .tp__head {
  animation-name: tpHeadLoop;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes tpHeadLoop {
  0% {
    --x: 0%;
  }
  86% {
    --x: 92%;
  }
  88% {
    --x: 0%;
  }
  100% {
    --x: 0%;
  }
}
@media (max-width: 340px) {
  .tp {
    gap: 8px;
  }
  .tp__card {
    padding: 8px;
    gap: 4px;
  }
  .tp__wave {
    height: 48px;
  }
  .tp__row {
    gap: 0;
  }
  .tp__bar {
    border-radius: 0;
  }
  .tp__play {
    padding: 4px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tp.is-demo .tp__lit,
  .tp.is-demo .tp__head {
    animation: none !important;
  }
  .tp.is-demo .tp__lit {
    clip-path: inset(0 40% 0 0) !important;
  }
  .tp.is-demo .tp__head {
    --x: 60% !important;
  }
}
