* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f9d9e2;
  font-family: "Press Start 2P", cursive;
  color: #3b2f2f;
}

#pet-fall-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

#app {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 2;
}

#card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 24px;
}

.pet-fall {
  position: absolute;
  top: -80px;
  animation-name: petFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.card-title {
  font-size: 16px;
  line-height: 1.5;
  margin: 6px 0 10px;
  text-align: center;
}

.pet-splash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.pet-splash-item {
  position: absolute;
  width: 120px;
  display: block;
  border: 3px solid #ffd5ea;
  border-radius: 8px;
  box-shadow:
    0 0 0 3px #db4ea0,
    0 10px 16px rgba(0, 0, 0, 0.2);
}

.pet-splash-cat {
  left: -74px;
  bottom: -72px;
  transform: rotate(-12deg);
  animation: splashPulseCat 1.2s ease-in-out infinite;
}

.pet-splash-dog {
  top: -78px;
  right: -72px;
  transform: rotate(12deg);
  animation: splashPulseDog 1.2s ease-in-out infinite;
}

.card-title.typewriter::after {
  content: "|";
  display: inline-block;
  margin-left: 2px;
  color: #c83f5f;
  animation: typeCaretBlink 0.8s steps(1, end) infinite;
}

.final-dynamic-title {
  line-height: 1.7;
}

.final-dynamic-title .title-word {
  display: inline-block;
  animation: titleFloat 1.8s ease-in-out infinite;
}

.final-dynamic-title .title-soft {
  color: #dd6b86;
  font-weight: 700;
  animation-delay: 0.12s;
}

.final-dynamic-title .title-strong {
  color: #c83f5f;
  font-weight: 700;
  animation: titlePulse 1.15s ease-in-out infinite;
}

.final-dynamic-title .title-heart {
  color: #ef5a7a;
  font-weight: 700;
  animation: titleWiggle 0.9s ease-in-out infinite;
}

.intro-you {
  color: #d54d79;
  font-weight: 700;
}

.intro-us {
  color: #b14567;
  font-weight: 700;
}

.card-subtitle {
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 16px;
  text-align: center;
  color: #6a4b4b;
}

.subtitle-highlight {
  color: #c83f5f;
  font-weight: 700;
}

.question-text {
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0 16px;
  text-align: center;
}

.prompt-highlight {
  color: #ce4f70;
  font-weight: 700;
}

.step-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 10px;
  border: 2px solid #f6d7df;
  margin: 6px 0 12px;
  display: block;
}

.progress {
  margin-bottom: 14px;
}

.progress-label {
  font-size: 10px;
  margin-bottom: 6px;
  color: #7d4c57;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #f1b3c4;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #e25572;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 16px;
}

.answers .nes-btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 10px;
  transition: background-color 0.18s ease;
}

.answers:not(.final) .nes-btn:hover,
.answers:not(.final) .nes-btn:focus-visible {
  background-color: #f9dbe5;
}

.answers.final {
  position: relative;
  min-height: 260px;
}

.answers.final .nes-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
}

.answers.final .nes-btn.free {
  transform: none;
}

.answers.final .no-btn.free {
  width: auto;
  min-width: 120px;
  left: 0;
  transform: none;
}

.big-btn {
  font-size: 12px;
  padding: 14px 16px;
}

#start-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  font-size: 10px;
}

#start-btn.nes-btn.is-primary,
.answers.final .nes-btn.is-primary {
  background-color: #e85b79;
  color: #fff;
  border-color: #d94c6a;
  box-shadow: inset -4px -4px #c33f5c;
}

#start-btn.nes-btn.is-primary::after,
.answers.final .nes-btn.is-primary::after {
  box-shadow: inset -4px -4px #c33f5c;
}

#start-btn.nes-btn.is-primary:hover,
#start-btn.nes-btn.is-primary:focus-visible,
.answers.final .nes-btn.is-primary:hover,
.answers.final .nes-btn.is-primary:focus-visible {
  background-color: #ef6f8c;
}

#start-btn.nes-btn.is-primary:hover::after,
#start-btn.nes-btn.is-primary:focus-visible::after,
.answers.final .nes-btn.is-primary:hover::after,
.answers.final .nes-btn.is-primary:focus-visible::after {
  box-shadow: inset -6px -6px #c33f5c;
}

#start-btn.nes-btn.is-primary:active,
.answers.final .nes-btn.is-primary:active {
  box-shadow: inset 4px 4px #c33f5c;
}

#start-btn.nes-btn.is-primary:active::after,
.answers.final .nes-btn.is-primary:active::after {
  box-shadow: inset 4px 4px #c33f5c;
}

.answers.final .nes-btn.is-error {
  background-color: #f6d0da;
  color: #7a3446;
  border-color: #e5a8b8;
  box-shadow: inset -4px -4px #d58ea2;
}

.answers.final .nes-btn.is-error::after {
  box-shadow: inset -4px -4px #d58ea2;
}

.answers.final .nes-btn.is-error:hover,
.answers.final .nes-btn.is-error:focus-visible {
  background-color: #f2bccb;
}

.answers.final .nes-btn.is-error:hover::after,
.answers.final .nes-btn.is-error:focus-visible::after {
  box-shadow: inset -6px -6px #d58ea2;
}

.answers.final .nes-btn.is-error:active {
  box-shadow: inset 4px 4px #d58ea2;
}

.answers.final .nes-btn.is-error:active::after {
  box-shadow: inset 4px 4px #d58ea2;
}

.answers.final .nes-btn.is-error:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.feedback {
  min-height: 18px;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: #b0495c;
}

.feedback.typewriter::after {
  content: "_";
  display: inline-block;
  margin-left: 1px;
  animation: typeCaretBlink 0.8s steps(1, end) infinite;
}

.hidden {
  display: none;
}

.success {
  text-align: center;
  padding: 10px 0 6px;
}

#restart-btn {
  width: 100%;
  margin-top: 14px;
}

.pixel-heart {
  position: absolute;
  top: -18px;
  right: 10px;
  z-index: 5;
  width: 6px;
  height: 6px;
  margin: 0;
  background: #e25572;
  box-shadow:
    6px 0 #e25572,
    18px 0 #e25572,
    24px 0 #e25572,
    0 6px #e25572,
    6px 6px #e25572,
    12px 6px #e25572,
    18px 6px #e25572,
    24px 6px #e25572,
    0 12px #e25572,
    6px 12px #e25572,
    12px 12px #e25572,
    18px 12px #e25572,
    24px 12px #e25572,
    6px 18px #e25572,
    12px 18px #e25572,
    18px 18px #e25572,
    12px 24px #e25572;
  transform: scale(1.4);
  transform-origin: center;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1.4);
  }
  50% {
    transform: scale(1.8);
  }
  100% {
    transform: scale(1.4);
  }
}

@keyframes typeCaretBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes splashPulseCat {
  0% {
    transform: rotate(-12deg) scale(0.96);
  }
  50% {
    transform: rotate(-12deg) scale(1.04);
  }
  100% {
    transform: rotate(-12deg) scale(0.96);
  }
}

@keyframes splashPulseDog {
  0% {
    transform: rotate(12deg) scale(0.96);
  }
  50% {
    transform: rotate(12deg) scale(1.04);
  }
  100% {
    transform: rotate(12deg) scale(0.96);
  }
}

@keyframes titleFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes titlePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes titleWiggle {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(8deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes petFall {
  0% {
    transform: translate3d(0, -80px, 0) rotate(-6deg);
  }
  50% {
    transform: translate3d(18px, 52vh, 0) rotate(8deg);
  }
  100% {
    transform: translate3d(-14px, 110vh, 0) rotate(-10deg);
  }
}

@media (max-width: 420px) {
  #card {
    padding: 18px;
  }

  .pet-splash {
    inset: 0;
  }

  .pet-splash-item {
    width: 96px;
  }

  .pet-splash-cat {
    left: -48px;
    bottom: -52px;
  }

  .pet-splash-dog {
    top: -56px;
    right: -48px;
  }

  .card-title {
    font-size: 14px;
  }

  .answers .nes-btn {
    font-size: 9px;
  }
}
