@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Merriweather:wght@700&display=swap");

html {
  min-height: 100%;
  background: #ffffff;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
}

.pet-quiz,
.pet-quiz * {
  box-sizing: border-box;
}

.pet-quiz {
  --quiz-ink: #111111;
  --quiz-copy: #666666;
  --quiz-muted: #858585;
  --quiz-purple: #6847e8;
  --quiz-purple-dark: #4d31bd;
  --quiz-purple-pale: #f3f0ff;
  --quiz-line: #e1e1e1;
  --quiz-panel: #f7f7f7;
  --result-color: #ffd84d;
  width: 100%;
  max-width: 530px;
  margin: 0 auto;
  overflow: hidden;
  color: var(--quiz-ink);
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 24px;
}

.pet-quiz button { font: inherit; }

.pet-quiz button:focus-visible {
  outline: 3px solid rgba(104, 71, 232, 0.28);
  outline-offset: 3px;
}

.pet-quiz .screen {
  width: 100%;
  padding: 32px;
  background: #ffffff;
  animation: quiz-screen-in 300ms ease-out both;
}

.pet-quiz .screen[hidden],
.pet-quiz .quiz-header[hidden] { display: none !important; }

.pet-quiz h1,
.pet-quiz h2,
.pet-quiz p { margin-top: 0; }

.pet-quiz .intro-screen {
  padding-top: 48px;
  padding-bottom: 52px;
}

.pet-quiz .quiz-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  color: var(--quiz-purple-dark);
  background: var(--quiz-purple-pale);
  border-radius: 50%;
  font-size: 20px;
}

.pet-quiz .eyebrow,
.pet-quiz .question-kicker {
  display: inline-block;
  color: var(--quiz-purple-dark);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-transform: uppercase;
}

.pet-quiz .intro-copy h1 {
  margin: 12px 0 22px;
  color: #000000;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 45px;
}

.pet-quiz .intro-copy > p:not(.time-note) {
  margin-bottom: 28px;
  color: #7f7f7f;
  font-size: 17px;
  line-height: 26px;
}

.pet-quiz .primary-button,
.pet-quiz .secondary-button {
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pet-quiz .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: #ffffff;
  border: 1px solid var(--quiz-purple);
  background: var(--quiz-purple);
}

.pet-quiz .primary-button:hover {
  border-color: var(--quiz-purple-dark);
  background: var(--quiz-purple-dark);
  transform: translateY(-1px);
}

.pet-quiz .secondary-button {
  color: var(--quiz-ink);
  border: 1px solid var(--quiz-line);
  background: #ffffff;
}

.pet-quiz .secondary-button:hover {
  border-color: #bcbcbc;
  background: var(--quiz-panel);
}

.pet-quiz .time-note {
  margin: 14px 0 0;
  color: var(--quiz-muted);
  font-size: 12px;
  line-height: 18px;
}

.pet-quiz .question-screen {
  min-height: 600px;
  padding-top: 28px;
  padding-bottom: 40px;
}

.pet-quiz .progress-row {
  min-height: 42px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.pet-quiz .back-button {
  padding: 7px 0;
  color: var(--quiz-copy);
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.pet-quiz .back-button:hover { color: var(--quiz-purple-dark); }

.pet-quiz .progress-copy {
  flex: 1;
  color: var(--quiz-copy);
  font-size: 12px;
  line-height: 18px;
}

.pet-quiz .progress-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: #ececec;
  border-radius: 999px;
}

.pet-quiz .progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  background: var(--quiz-purple);
  border-radius: inherit;
  transition: width 300ms ease;
}

.pet-quiz .question-card {
  padding: 26px 24px 28px;
  background: #ffffff;
  border: 1px solid var(--quiz-line);
  border-radius: 8px;
}

.pet-quiz .question-card.question-refresh { animation: quiz-question-in 260ms ease-out both; }

.pet-quiz .question-card h2 {
  margin: 10px 0 25px;
  color: #000000;
  font-family: Merriweather, Georgia, serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 32px;
}

.pet-quiz .answer-list {
  display: grid;
  gap: 10px;
}

.pet-quiz .answer-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #333333;
  text-align: left;
  border: 1px solid #dddddd;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.pet-quiz .answer-button:hover {
  border-color: #9d8be9;
  background: #faf9ff;
  transform: translateY(-1px);
}

.pet-quiz .answer-button.selected {
  color: #ffffff;
  border-color: var(--quiz-purple);
  background: var(--quiz-purple);
}

.pet-quiz .answer-letter {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--quiz-purple-dark);
  background: var(--quiz-purple-pale);
  border-radius: 50%;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.pet-quiz .answer-button.selected .answer-letter {
  color: var(--quiz-purple-dark);
  background: #ffffff;
}

.pet-quiz .answer-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 21px;
}

.pet-quiz .keyboard-note {
  margin: 17px 0 0;
  color: var(--quiz-muted);
  text-align: center;
  font-size: 12px;
  line-height: 18px;
}

.pet-quiz .loading-screen {
  min-height: 500px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.pet-quiz .loading-screen h2 {
  margin: 16px 0 12px;
  color: #000000;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 40px;
}

.pet-quiz .loading-screen p { color: var(--quiz-copy); }

.pet-quiz .sniffer {
  position: relative;
  width: 130px;
  height: 100px;
  margin-bottom: 24px;
}

.pet-quiz .sniffer-nose {
  position: absolute;
  left: 30px;
  top: 25px;
  width: 68px;
  height: 52px;
  background: #222222;
  border-radius: 48% 48% 58% 58%;
  animation: quiz-nose-bob 780ms ease-in-out infinite alternate;
}

.pet-quiz .sniffer-nose::before,
.pet-quiz .sniffer-nose::after {
  content: "";
  position: absolute;
  top: 18px;
  width: 10px;
  height: 6px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
}

.pet-quiz .sniffer-nose::before { left: 14px; }
.pet-quiz .sniffer-nose::after { right: 14px; }

.pet-quiz .sniff-line {
  position: absolute;
  right: 1px;
  width: 30px;
  height: 17px;
  border-top: 2px solid var(--quiz-purple);
  border-radius: 50%;
  opacity: 0;
  animation: quiz-sniff 1050ms ease-out infinite;
}

.pet-quiz .sniff-one { top: 18px; }
.pet-quiz .sniff-two { top: 42px; animation-delay: 170ms; }
.pet-quiz .sniff-three { top: 67px; animation-delay: 340ms; }

.pet-quiz .result-screen {
  padding-top: 32px;
  padding-bottom: 44px;
}

.pet-quiz .result-card { background: #ffffff; }

.pet-quiz .result-photo-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--result-color);
  border-radius: 8px;
}

.pet-quiz .result-photo-wrap img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  object-position: center;
}

.pet-quiz .result-photo-wrap.image-unavailable img { visibility: hidden; }

.pet-quiz .result-photo-wrap.image-unavailable::after {
  content: "Portrait loading…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, 0.62);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.pet-quiz .result-stamp {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 10px;
  color: #222222;
  background: #ffffff;
  border-radius: 999px;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 15px;
  text-transform: uppercase;
}

.pet-quiz .result-content { padding-top: 28px; }

.pet-quiz .result-content h2 {
  margin: 6px 0 7px;
  color: #000000;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 46px;
}

.pet-quiz .result-title {
  margin: 0 0 18px;
  color: #333333;
  font-family: Merriweather, Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 25px;
}

.pet-quiz .trait-list {
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pet-quiz .trait-list span {
  padding: 6px 9px;
  color: var(--quiz-purple-dark);
  background: var(--quiz-purple-pale);
  border-radius: 999px;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 15px;
}

.pet-quiz .result-description p {
  margin: 0 0 16px;
  color: #666666;
  font-size: 16px;
  line-height: 24px;
}

.pet-quiz .signature-box {
  margin: 26px 0;
  padding: 18px 18px 19px;
  border-left: 4px solid var(--result-color);
  background: var(--quiz-panel);
  border-radius: 0 8px 8px 0;
}

.pet-quiz .signature-box span,
.pet-quiz .signature-box strong { display: block; }

.pet-quiz .signature-box span {
  margin-bottom: 5px;
  color: var(--quiz-copy);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 15px;
  text-transform: uppercase;
}

.pet-quiz .signature-box strong {
  color: #222222;
  font-family: Merriweather, Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
}

.pet-quiz .result-actions {
  display: flex;
  gap: 10px;
}

.pet-quiz .result-actions button { flex: 1; }

.pet-quiz .share-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--quiz-purple-dark);
  text-align: center;
  font-size: 12px;
  line-height: 18px;
}

.pet-quiz .adoption-card {
  margin-top: 24px;
  padding: 16px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 11px;
  background: #fffaf0;
  border: 1px solid var(--quiz-line);
  border-radius: 8px;
}

.pet-quiz .adoption-icon {
  position: relative;
  width: 34px;
  height: 34px;
  display: block;
  background: var(--result-color);
  border-radius: 50%;
}

.pet-quiz .adoption-icon::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 12px;
  left: 10px;
  top: 12px;
  background: #222222;
  border-radius: 55% 55% 45% 45%;
}

.pet-quiz .adoption-card strong {
  display: block;
  color: #333333;
  font-family: Merriweather, Georgia, serif;
  font-size: 13px;
  line-height: 19px;
}

.pet-quiz .adoption-card p {
  margin: 4px 0 0;
  color: var(--quiz-copy);
  font-size: 12px;
  line-height: 18px;
}

.pet-quiz .adoption-card button {
  grid-column: 1 / -1;
  width: 100%;
  padding: 8px 10px;
  color: var(--quiz-copy);
  border: 1px solid var(--quiz-line);
  background: #ffffff;
  border-radius: 6px;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.pet-quiz .fun-note {
  margin: 17px 0 0;
  color: var(--quiz-muted);
  font-size: 11px;
  line-height: 17px;
}

@keyframes quiz-screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes quiz-question-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes quiz-nose-bob {
  from { transform: translateY(-3px) rotate(-4deg); }
  to { transform: translateY(4px) rotate(2deg); }
}

@keyframes quiz-sniff {
  0% { opacity: 0; transform: translateX(-6px) scale(0.75); }
  35% { opacity: 0.75; }
  100% { opacity: 0; transform: translateX(14px) scale(1.2); }
}

@media screen and (max-width: 600px) {
  .pet-quiz .screen {
    padding-right: 20px;
    padding-left: 20px;
  }

  .pet-quiz .intro-screen {
    padding-top: 38px;
    padding-bottom: 44px;
  }

  .pet-quiz .intro-copy h1 {
    font-size: 32px;
    line-height: 38px;
  }

  .pet-quiz .intro-copy > p:not(.time-note) {
    font-size: 16px;
    line-height: 24px;
  }

  .pet-quiz .question-screen {
    min-height: 560px;
    padding-top: 22px;
    padding-bottom: 32px;
  }

  .pet-quiz .question-card { padding: 23px 18px 22px; }

  .pet-quiz .question-card h2 {
    font-size: 22px;
    line-height: 29px;
  }

  .pet-quiz .answer-button { min-height: 56px; }

  .pet-quiz .result-screen {
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .pet-quiz .result-content h2 {
    font-size: 38px;
    line-height: 42px;
  }
}

@media screen and (max-width: 390px) {
  .pet-quiz .result-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .pet-quiz *,
  .pet-quiz *::before,
  .pet-quiz *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
