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

.fb {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(320px, 92vw);
}

.fb__name {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.fb__slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ffffff;
  overflow: hidden;
}

.fb__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.fb__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34px;
  background: rgba(23, 20, 26, 0.12);
  animation-name: fbShine;
  animation-duration: 1s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.fb__initial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #17141a;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  opacity: 0;
}

.fb__mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #17141a;
  opacity: 0;
}

.fb__mark svg {
  width: 34px;
  height: 34px;
}

.fb[data-step=photo] .fb__photo {
  opacity: 1;
}

.fb[data-step=initials] .fb__initial {
  opacity: 1;
}

.fb[data-step=mark] .fb__mark {
  opacity: 1;
}

.fb__step {
  display: grid;
  justify-items: center;
  margin: 0;
}

.fb__stepTxt {
  grid-area: 1/1;
  color: #4a4452;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
}

.fb[data-step=photo] .fb__stepTxt--photo,
.fb[data-step=initials] .fb__stepTxt--initials,
.fb[data-step=mark] .fb__stepTxt--mark {
  opacity: 1;
}

.fb__btn {
  display: grid;
  margin: 0;
  padding: 8px 20px;
  border: 0;
  border-radius: 12px;
  background: #17141a;
  color: #ffd23f;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

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

.fb__btnTxt {
  grid-area: 1/1;
  visibility: hidden;
}

.fb[data-step=initials] .fb__btnTxt--mark,
.fb[data-step=mark] .fb__btnTxt--initials {
  visibility: visible;
}

.fb.is-demo .fb__photo,
.fb.is-demo .fb__stepTxt--photo {
  animation-name: fbCutPhoto;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.fb.is-demo .fb__initial,
.fb.is-demo .fb__stepTxt--initials {
  animation-name: fbCutInitial;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.fb.is-demo .fb__mark,
.fb.is-demo .fb__stepTxt--mark {
  animation-name: fbCutMark;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes fbCutPhoto {
  0% {
    opacity: 1;
  }
  34% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes fbCutInitial {
  0% {
    opacity: 0;
  }
  34% {
    opacity: 1;
  }
  67% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes fbCutMark {
  0% {
    opacity: 0;
  }
  67% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes fbShine {
  0% {
    transform: translateX(-40px);
  }
  100% {
    transform: translateX(80px);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .fb {
    gap: 8px;
  }
  .fb__slot {
    width: 56px;
    height: 56px;
  }
  .fb__initial {
    font-size: 22px;
  }
  .fb__mark svg {
    width: 28px;
    height: 28px;
  }
  .fb__name {
    font-size: 12px;
  }
  .fb__stepTxt {
    font-size: 11px;
  }
  .fb__btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fb__photo, .fb__initial, .fb__mark, .fb__stepTxt, .fb__shine {
    animation: none !important;
  }
}
