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

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

.ck {
  width: min(92vw, 400px);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.ck__hit {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ck__hit:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 4px;
  border-radius: 50%;
}

.ck__scene {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 16/9;
}

.ck__cookieWrap {
  position: absolute;
  left: 6%;
  bottom: 8%;
  width: 42%;
  aspect-ratio: 1;
}

.ck__cookie {
  position: absolute;
  inset: 0;
  background: #fff7e6;
  border: 5px solid #c93000;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
}

.ck__chip {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  background: #17141a;
  border-radius: 50%;
}

.ck__chip--1 {
  top: 18%;
  left: 22%;
}

.ck__chip--2 {
  top: 42%;
  left: 60%;
}

.ck__chip--3 {
  top: 66%;
  left: 30%;
}

.ck__chip--4 {
  top: 12%;
  left: 58%;
}

.ck__chip--5 {
  top: 58%;
  left: 10%;
}

.ck[data-bite="1"] .ck__cookie {
  clip-path: circle(44% at 60% 38%);
}

.ck[data-bite="2"] .ck__cookie {
  clip-path: circle(36% at 66% 44%);
}

.ck[data-bite="3"] .ck__cookie {
  clip-path: circle(26% at 70% 52%);
}

.ck[data-bite="4"] .ck__cookie {
  clip-path: circle(15% at 72% 58%);
}

.ck__crumb {
  position: absolute;
  bottom: -8%;
  width: 8%;
  aspect-ratio: 1;
  background: #fff7e6;
  border-radius: 50%;
  transform: scale(0);
  animation-name: ckCrumb;
  animation-duration: 2s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

.ck__crumb--1 {
  left: 30%;
}

.ck__crumb--2 {
  left: 48%;
  animation-delay: 0.1s;
}

.ck__crumb--3 {
  left: 62%;
  animation-delay: 0.2s;
}

@keyframes ckCrumb {
  0% {
    transform: translateY(-6px) scale(0);
  }
  10% {
    transform: translateY(0) scale(1);
  }
  55% {
    transform: translateY(18px) scale(1);
  }
  70%, 100% {
    transform: translateY(22px) scale(0);
  }
}
.ck__char {
  --puff: 0;
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: 34%;
  aspect-ratio: 1/0.92;
  background: #4cd4a6;
  border: 3px solid #17141a;
  border-radius: 50% 50% 46% 46%/44% 44% 56% 56%;
}

.ck__eye, .ck__sad {
  position: absolute;
  top: 34%;
  width: 12%;
  aspect-ratio: 1;
}

.ck__eye {
  background: #17141a;
  border-radius: 50%;
}

.ck__eye--l {
  left: 26%;
}

.ck__eye--r {
  left: 58%;
}

.ck__sad {
  border-bottom: 4px solid #17141a;
  border-radius: 50%;
  visibility: hidden;
}

.ck__sad--l {
  left: 26%;
}

.ck__sad--r {
  left: 58%;
}

.ck[data-bite="4"] .ck__eye {
  visibility: hidden;
}

.ck[data-bite="4"] .ck__sad {
  visibility: visible;
}

.ck__cheek {
  position: absolute;
  top: 46%;
  width: 22%;
  aspect-ratio: 1;
  background: #ff9ebb;
  border-radius: 50%;
  opacity: 0.75;
  transform: scale(calc(1 + var(--puff)));
  transform-origin: 50% 50%;
}

.ck__cheek--l {
  left: 0;
}

.ck__cheek--r {
  right: 0;
}

.ck[data-bite="1"] .ck__char {
  --puff: .05;
}

.ck[data-bite="2"] .ck__char {
  --puff: .1;
}

.ck[data-bite="3"] .ck__char, .ck[data-bite="4"] .ck__char {
  --puff: .16;
}

.ck__mouth {
  position: absolute;
  top: 56%;
  left: 50%;
  width: 18%;
  height: 9%;
  border: 3px solid #17141a;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.ck__arm {
  position: absolute;
  top: 42%;
  left: -18%;
  width: 40%;
  height: 12%;
  background: #4cd4a6;
  border: 3px solid #17141a;
  border-radius: 999px;
  transform: rotate(24deg);
}

.ck__reset {
  padding: 0 16px;
  background: #fff7e6;
  color: #17141a;
  border: 2px solid #fff7e6;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
}

.ck__reset:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.ck.is-demo .ck__cookie {
  animation-name: ckEat;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes ckEat {
  0%, 19% {
    clip-path: circle(50% at 50% 50%);
  }
  20%, 39% {
    clip-path: circle(44% at 60% 38%);
  }
  40%, 59% {
    clip-path: circle(36% at 66% 44%);
  }
  60%, 79% {
    clip-path: circle(26% at 70% 52%);
  }
  80%, 100% {
    clip-path: circle(50% at 50% 50%);
  }
}
.ck.is-demo .ck__cheek {
  animation-name: ckPuff;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes ckPuff {
  0%, 19% {
    transform: scale(1);
  }
  20%, 39% {
    transform: scale(1.18);
  }
  40%, 59% {
    transform: scale(1.36);
  }
  60%, 79% {
    transform: scale(1.56);
  }
  80%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .ck__cookie {
    border-width: 3px;
  }
  .ck__char {
    border-width: 2px;
  }
  .ck__reset {
    font-size: 11px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ck.is-demo .ck__cookie,
  .ck.is-demo .ck__cheek,
  .ck__crumb {
    animation: none !important;
  }
  .ck__crumb {
    transform: scale(0);
  }
}
