html, body {
  margin: 0;
  overflow: hidden;
}

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

.ff {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 424px;
}

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

.ff__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #ff4d1f;
}

.ff__field {
  position: relative;
  height: 176px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.14);
  overflow: hidden;
  touch-action: none;
}

.ff__field:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.ff__part {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 4px;
  border-radius: 999px;
  background: #17141a;
}

.ff__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ff__dir {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ff__dirLabel {
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  color: #17141a;
}

.ff__dirBox {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 20px;
  border-radius: 4px;
  padding: 0 4px;
  background: rgba(23, 20, 26, 0.12);
  color: #17141a;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1;
}

.ff__dirLoop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
}

.ff__dirLoop i {
  grid-area: 1/1;
  font-style: normal;
  visibility: hidden;
}

.ff__reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 999px;
  padding: 4px 12px;
  background: #17141a;
  color: #ffd23f;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1;
}

.ff__reset .ff__ico {
  color: #ffd23f;
}

.ff.is-demo .ff__part {
  animation-name: ffOrbit;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--i) * -56ms);
}

@keyframes ffOrbit {
  0% {
    transform: translate(var(--hx), var(--hy)) rotate(0deg);
  }
  25% {
    transform: translate(calc(var(--hx) + var(--rx)), calc(var(--hy) - var(--ry))) rotate(90deg);
  }
  50% {
    transform: translate(var(--hx), calc(var(--hy) - var(--ry) * 2)) rotate(180deg);
  }
  75% {
    transform: translate(calc(var(--hx) - var(--rx)), calc(var(--hy) - var(--ry))) rotate(270deg);
  }
  100% {
    transform: translate(var(--hx), var(--hy)) rotate(360deg);
  }
}
.ff.is-demo .ff__dirVal {
  color: transparent;
}

.ff.is-demo .ff__dirLoop {
  visibility: visible;
}

.ff.is-demo .ff__dirLoop i {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ff.is-demo .ff__dirLoop i:nth-child(1) {
  animation-name: ffDirR;
}

.ff.is-demo .ff__dirLoop i:nth-child(2) {
  animation-name: ffDirL;
}

@keyframes ffDirR {
  0%, 49% {
    visibility: visible;
  }
  50%, 100% {
    visibility: hidden;
  }
}
@keyframes ffDirL {
  0%, 49% {
    visibility: hidden;
  }
  50%, 100% {
    visibility: visible;
  }
}
@media (max-width: 340px) {
  .ff {
    gap: 8px;
  }
  .ff__field {
    height: 104px;
  }
  .ff__part {
    width: 11px;
    height: 3px;
  }
  .ff__dirBox {
    min-width: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ff.is-demo .ff__part,
  .ff.is-demo .ff__dirLoop i {
    animation: none !important;
  }
  .ff.is-demo .ff__part {
    transform: translate(var(--hx), var(--hy)) !important;
  }
  .ff.is-demo .ff__dirVal {
    color: #17141a !important;
  }
  .ff.is-demo .ff__dirLoop {
    visibility: hidden !important;
  }
}
