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

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

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

.pg__ico {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #17141a;
}

.pg__row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.pg__char {
  position: relative;
  width: 160px;
  height: 118px;
  flex: 0 0 auto;
}

.pg__body {
  position: absolute;
  left: 38px;
  top: 26px;
  width: 84px;
  height: 92px;
  border-radius: 50% 50% 46% 46%;
  background: #fff7e6;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.pg__eye {
  position: absolute;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
}

.pg__eye--l {
  left: 16px;
}

.pg__eye--r {
  left: 52px;
}

.pg__pupil {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17141a;
  transform: translateX(3px);
}

.pg__cheek {
  position: absolute;
  top: 48px;
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: #ff9ebb;
  opacity: 0.9;
}

.pg__cheek--l {
  left: 8px;
}

.pg__cheek--r {
  right: 8px;
}

.pg__mouth {
  position: absolute;
  top: 54px;
  left: 34px;
  width: 16px;
  height: 8px;
  border-bottom: 3px solid #17141a;
  border-radius: 0 0 999px 999px;
}

.pg__arm {
  position: absolute;
  left: 110px;
  top: 22px;
  width: 12px;
  height: 40px;
  border-radius: 999px;
  background: #fff7e6;
  transform-origin: 50% 95%;
  transform: rotate(80deg);
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.pg__side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.pg__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  border: 0;
  border-radius: 12px;
  padding: 4px 12px;
  background: #17141a;
  color: #fff7e6;
  font-weight: 800;
  font-size: clamp(11px, 2.8vw, 13px);
  line-height: 1.2;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  cursor: pointer;
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}

.pg__btn:active {
  transform: scale(0.96);
  box-shadow: none;
}

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

.pg__btnIco {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.pg__say {
  position: relative;
  height: 44px;
  margin: 0;
}

.pg__msg {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.4;
  color: #17141a;
}

.pg[data-step="0"] .pg__msg--0,
.pg[data-step="1"] .pg__msg--1,
.pg[data-step="2"] .pg__msg--2 {
  display: flex;
}

.is-demo .pg__msg {
  display: flex;
  visibility: hidden;
  opacity: 0;
}

@keyframes pgPoint {
  0%, 31% {
    transform: rotate(80deg);
  }
  34% {
    transform: rotate(92deg);
  }
  37%, 62% {
    transform: rotate(80deg);
  }
  65% {
    transform: rotate(92deg);
  }
  68%, 86% {
    transform: rotate(80deg);
  }
  88% {
    transform: rotate(92deg);
  }
  90%, 100% {
    transform: rotate(80deg);
  }
}
@keyframes pgLook {
  0% {
    transform: translateX(0);
  }
  8%, 100% {
    transform: translateX(3px);
  }
}
@keyframes pgGlow {
  0%, 2% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 0 rgba(255, 247, 230, 0.55);
  }
  26% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 12px rgba(255, 247, 230, 0);
  }
  33%, 38% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 0 rgba(255, 247, 230, 0);
  }
  40% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 0 rgba(255, 247, 230, 0.55);
  }
  57% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 12px rgba(255, 247, 230, 0);
  }
  63%, 68% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 0 rgba(255, 247, 230, 0);
  }
  70% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 0 rgba(255, 247, 230, 0.55);
  }
  84% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 12px rgba(255, 247, 230, 0);
  }
  90%, 100% {
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32), 0 0 0 0 rgba(255, 247, 230, 0);
  }
}
@keyframes pgMsg0 {
  0%, 30% {
    opacity: 1;
    visibility: visible;
  }
  31%, 86% {
    opacity: 0;
    visibility: hidden;
  }
  87%, 100% {
    opacity: 1;
    visibility: visible;
  }
}
@keyframes pgMsg1 {
  0%, 31% {
    opacity: 0;
    visibility: hidden;
  }
  32%, 61% {
    opacity: 1;
    visibility: visible;
  }
  62%, 100% {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes pgMsg2 {
  0%, 62% {
    opacity: 0;
    visibility: hidden;
  }
  63%, 86% {
    opacity: 1;
    visibility: visible;
  }
  87%, 100% {
    opacity: 0;
    visibility: hidden;
  }
}
.is-demo .pg__arm {
  animation-name: pgPoint;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.is-demo .pg__pupil {
  animation-name: pgLook;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.is-demo .pg__btn {
  animation-name: pgGlow;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

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

.is-demo .pg__msg--0 {
  animation-name: pgMsg0;
}

.is-demo .pg__msg--1 {
  animation-name: pgMsg1;
}

.is-demo .pg__msg--2 {
  animation-name: pgMsg2;
}

@keyframes pgNod {
  0% {
    transform: rotate(80deg);
  }
  35% {
    transform: rotate(126deg);
  }
  70%, 100% {
    transform: rotate(80deg);
  }
}
.pg.is-bump .pg__arm {
  animation-name: pgNod;
  animation-duration: 640ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: 1;
  animation-fill-mode: both;
}

@media (max-width: 340px) {
  .pg {
    gap: 8px;
  }
  .pg__row {
    gap: 8px;
  }
  .pg__char {
    width: 124px;
    height: 96px;
  }
  .pg__body {
    left: 27px;
    top: 20px;
    width: 70px;
    height: 76px;
  }
  .pg__eye {
    top: 21px;
    width: 13px;
    height: 13px;
  }
  .pg__eye--l {
    left: 12px;
  }
  .pg__eye--r {
    left: 45px;
  }
  .pg__pupil {
    left: 3px;
    top: 3px;
    width: 6px;
    height: 6px;
  }
  .pg__cheek {
    top: 40px;
    width: 10px;
    height: 5px;
  }
  .pg__cheek--l {
    left: 7px;
  }
  .pg__cheek--r {
    right: 7px;
  }
  .pg__mouth {
    top: 45px;
    left: 28px;
    width: 14px;
    height: 7px;
  }
  .pg__arm {
    left: 86px;
    top: 16px;
    width: 10px;
    height: 34px;
  }
  .pg__say {
    height: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .pg__arm,
  .is-demo .pg__pupil,
  .is-demo .pg__btn {
    animation: none !important;
  }
  .is-demo .pg__msg--0,
  .is-demo .pg__msg--1,
  .is-demo .pg__msg--2 {
    animation: none !important;
  }
  .is-demo[data-step="0"] .pg__msg--0,
  .is-demo[data-step="1"] .pg__msg--1,
  .is-demo[data-step="2"] .pg__msg--2 {
    visibility: visible !important;
    opacity: 1 !important;
  }
  .pg.is-bump .pg__arm {
    animation: none !important;
  }
  .pg__btn {
    transition: none !important;
  }
}
