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

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

.ku {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 8px;
}

.ku [hidden] {
  display: none;
}

.ku__order {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #ffffff;
  color: #17141a;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.2;
}

.ku__sheet {
  padding: clamp(8px, 3.4vw, 12px);
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  transform-origin: 50% 50%;
}

.ku__title {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.2;
}

.ku__combo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  padding: clamp(4px, 2.4vw, 8px);
  border-radius: 8px;
  background: #ffffff;
}

.ku__items {
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.2;
}

.ku__diff {
  display: flex;
  align-items: baseline;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: clamp(15px, 4.4vw, 20px);
  line-height: 1.2;
  color: #17141a;
}

.ku__won {
  padding-left: 4px;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 13px);
}

.ku__odo {
  display: block;
  overflow: hidden;
  height: 1.2em;
}

.ku__roll {
  display: block;
  transform: translateY(-80%);
}

.ku__roll b {
  display: block;
  text-align: right;
  font-weight: 800;
  line-height: 1.2;
}

.ku__btns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ku__btn {
  width: 100%;
  padding: clamp(8px, 3vw, 12px) 8px;
  cursor: pointer;
  border: 2px solid #17141a;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(11px, 3.2vw, 14px);
  line-height: 1.2;
}

.ku__btn--yes {
  background: #17141a;
  color: #fff7e6;
}

.ku__btn--no {
  background: #ffffff;
  color: #17141a;
}

.ku__btn:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.ku__sum {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #17141a;
  color: #fff7e6;
  text-align: right;
  font-weight: 800;
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.2;
}

.ku__sum:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.ku.is-demo .ku__sheet {
  animation-name: kuPop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes kuPop {
  0% {
    transform: translateY(8px) scale(0.72);
    animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  }
  26% {
    transform: translateY(0) scale(1);
    animation-timing-function: steps(1, end);
  }
  86% {
    transform: translateY(8px) scale(0.72);
  }
  100% {
    transform: translateY(8px) scale(0.72);
  }
}
.ku.is-demo .ku__roll {
  animation-name: kuRoll;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes kuRoll {
  0% {
    transform: translateY(0);
  }
  24% {
    transform: translateY(0);
    animation-timing-function: ease-out;
  }
  64% {
    transform: translateY(-80%);
    animation-timing-function: steps(1, end);
  }
  86% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .ku {
    gap: 4px;
  }
  .ku__order, .ku__sum {
    padding: 4px 8px;
  }
  .ku__title {
    margin: 0 0 4px;
  }
  .ku__combo {
    margin: 0 0 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ku.is-demo .ku__sheet,
  .ku.is-demo .ku__roll {
    animation: none !important;
  }
  .ku.is-demo .ku__sheet {
    transform: translateY(0) scale(1) !important;
  }
  .ku.is-demo .ku__roll {
    transform: translateY(-80%) !important;
  }
}
