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);
}

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

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

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

.gd__field {
  position: relative;
  height: 176px;
  border-radius: 16px;
  background: rgba(255, 247, 230, 0.5);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.16);
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
}

.gd__field:focus-visible {
  outline: 2px solid #ff4d1f;
  outline-offset: 2px;
}

.gd__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(23, 20, 26, 0.35);
}

.gd__ball {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: #17141a;
}

.gd__ball--a {
  width: 28px;
  height: 28px;
  --bx: 34px;
  --by: 148px;
  --h: 140px;
}

.gd__ball--b {
  width: 20px;
  height: 20px;
  background: #ff4d1f;
  --bx: 132px;
  --by: 156px;
  --h: 104px;
}

.gd__ball--c {
  width: 24px;
  height: 24px;
  background: #2f6df6;
  --bx: 230px;
  --by: 152px;
  --h: 122px;
}

.gd__ball--d {
  width: 16px;
  height: 16px;
  --bx: 322px;
  --by: 160px;
  --h: 88px;
}

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

.gd__dial {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  color: #17141a;
}

.gd__dial input {
  width: 88px;
  accent-color: #ff4d1f;
}

.gd__val {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
}

.gd__drop {
  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;
}

.gd__drop .gd__ico {
  color: #ffd23f;
}

.gd.is-demo .gd__ball--a {
  animation: gdBounceA 2s linear infinite;
}

.gd.is-demo .gd__ball--b {
  animation: gdBounceA 2s linear infinite;
  animation-delay: -660ms;
}

.gd.is-demo .gd__ball--c {
  animation: gdBounceA 2s linear infinite;
  animation-delay: -330ms;
}

.gd.is-demo .gd__ball--d {
  animation: gdBounceA 2s linear infinite;
  animation-delay: -880ms;
}

@keyframes gdBounceA {
  0% {
    transform: translate(var(--bx), var(--by));
  }
  3% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.21));
  }
  6% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.57));
  }
  9% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 1));
  }
  12% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.57));
  }
  15% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.21));
  }
  18% {
    transform: translate(var(--bx), var(--by));
  }
  24% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.4));
  }
  30% {
    transform: translate(var(--bx), var(--by));
  }
  34% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.23));
  }
  38% {
    transform: translate(var(--bx), var(--by));
  }
  41% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.11));
  }
  44% {
    transform: translate(var(--bx), var(--by));
  }
  46% {
    transform: translate(var(--bx), calc(var(--by) - var(--h) * 0.04));
  }
  48% {
    transform: translate(var(--bx), var(--by));
  }
  100% {
    transform: translate(var(--bx), var(--by));
  }
}
@media (max-width: 340px) {
  .gd {
    gap: 8px;
  }
  .gd__field {
    height: 104px;
  }
  .gd__ball--a {
    width: 20px;
    height: 20px;
    --by: 84px;
    --h: 72px;
  }
  .gd__ball--b {
    width: 16px;
    height: 16px;
    --by: 88px;
    --h: 56px;
  }
  .gd__ball--c {
    width: 18px;
    height: 18px;
    --by: 86px;
    --h: 64px;
  }
  .gd__ball--d {
    width: 12px;
    height: 12px;
    --by: 92px;
    --h: 48px;
  }
  .gd__dial input {
    width: 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gd.is-demo .gd__ball--a,
  .gd.is-demo .gd__ball--b,
  .gd.is-demo .gd__ball--c,
  .gd.is-demo .gd__ball--d {
    animation: none !important;
  }
  .gd.is-demo .gd__ball {
    transform: translate(var(--bx), var(--by)) !important;
  }
}
