* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
}

body {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: #fff;
}

img {
  display: block;
  max-width: 100%;
}

footer {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Background */

.bg-image {
  position: fixed;
  inset: 0;
  z-index: -2;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  filter: blur(4px) brightness(70%);
  transform: scale(1.04);

  pointer-events: none;
  user-select: none;
}

.quiz {
  width: min(70%, 1100px);
  margin: 10rem auto 2rem;
}

/* Intro */

h1 {
  color: #fff;
}

p {
  margin-bottom: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.72);
}

.quiz-title {
  max-width: 90rem;
  margin: 0 0 1.4rem;

  font-size: clamp(3.2rem, 4vw, 6.4rem);
  line-height: 1.08;
  letter-spacing: -0.045em;

  color: #fff;
  text-wrap: balance;
}

.quiz-intro {
  max-width: 70rem;
  margin-bottom: 6rem;

  font-size: clamp(1.35rem, 1vw, 1.8rem);
  line-height: 1.35;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86);
}

/* Questions */

.question {
  position: relative;
  margin-bottom: 3.2rem;
  padding: clamp(2rem, 3vw, 3.2rem);
}

.question h3 {
  max-width: 900px;
  margin-bottom: 2.8rem;

  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #fff;
}

.labels {
  display: flex;
  justify-content: space-between;
  gap: 2rem;

  margin-bottom: 2.2rem;

  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 700;
}

.labels span:last-child {
  text-align: right;
}

/* Slider */

.trait-slider,
.steps {
  width: calc(100% - 4rem);
  margin-inline: auto;
}

.trait-slider {
  display: block;
  height: 8px;

  -webkit-appearance: none;
  appearance: none;

  background-color: transparent;
  border: 0;
  border-radius: 999px;
  outline: none;
  box-shadow: none;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.trait-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.trait-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.trait-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  width: 4rem;
  height: 4rem;

  background-color: transparent;
  background-image: url("assets/trophy.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;

  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;

  cursor: pointer;
  margin-top: -1.9rem;

  -webkit-filter: none;
  filter: none;
}

.trait-slider::-moz-range-thumb {
  width: 4rem;
  height: 4rem;

  background-color: transparent;
  background-image: url("assets/trophy.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;

  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;

  cursor: pointer;
}

/* Steps */

.steps {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;

  color: #fff;
  font-size: 13px;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: auto;
  min-width: 2.4rem;
  margin: 0;
  padding: 0.4rem 0.7rem;

  background: transparent;
  color: rgba(255, 255, 255, 0.82);

  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;

  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.step-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.step-btn.active {
  background: #22c55e;
  color: #052e16;
  border-color: #22c55e;
}

/* Button */

button {
  font-family: inherit;
}

#submit-btn,
#restart-btn {
  display: block;
  width: auto;
  min-width: 18rem;
  margin-inline: auto;

  border: none;
  border-radius: 999px;
  padding: 1.2rem 2rem;

  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;

  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

#submit-btn {
  margin-top: 4rem;
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 1rem 2.5rem rgba(34, 197, 94, 0.28);
}

#restart-btn {
  background: #fff;
  color: #0f0f0f;
}

#submit-btn:hover,
#restart-btn:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

/* Result */

.result-card {
  max-width: 620px;
  margin: 4rem auto;
  padding: 3rem;
  text-align: center;

  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.18), transparent 42%),
    rgba(0, 0, 0, 0.72);

  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 2rem;

  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);

  animation: resultFadeIn 0.45s ease both;
  scroll-margin-top: 120px;
}

.result-image-wrap {
  position: relative;

  width: 28rem;
  height: 28rem;
  margin: 2rem auto;

  border-radius: 50%;
  overflow: hidden;

  border: 4px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1rem 3rem rgba(0, 0, 0, 0.45),
    0 0 0 0.6rem rgba(34, 197, 94, 0.12);
}

#result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;

  opacity: 0;
  transition: opacity 0.35s ease;
}

#result-image.loaded {
  opacity: 1;
}

#result-name {
  margin-bottom: 1rem;

  font-size: clamp(3rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

#result-description {
  max-width: 520px;
  margin: 0 auto;

  color: #e5e5e5;
  font-size: 1.3rem;
  line-height: 1.6;
}

.match {
  margin: 2rem 0;

  color: #fff;
  font-size: 1.4rem;
}

.match strong {
  color: #22c55e;
  font-size: 2rem;
}

.result-loader {
  position: absolute;
  inset: 0;
  z-index: 2;

  border-radius: 50%;

  background: linear-gradient(90deg, #1f1f1f 25%, #333 50%, #1f1f1f 75%);
  background-size: 200% 100%;

  animation: shimmer 1.2s infinite;
}

.result-loader.hidden {
  display: none;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes resultFadeIn {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */

@media (max-width: 769px) {
  html {
    font-size: 50%;
  }

  .bg-image {
    object-fit: cover;
  }

  .quiz {
    width: 98%;
    margin-top: 2rem;
    padding: 2rem;
  }

  .quiz-title {
    font-size: clamp(3.8rem, 12vw, 6rem);
  }

  .quiz-intro {
    margin-bottom: 2rem;
    font-size: 1.5rem;
  }

  .question {
    padding: 2rem 1.5rem;
    margin-bottom: 2.2rem;
  }

  .question h3 {
    font-size: 2rem;
  }

  .labels {
    font-size: 1.4rem;
  }

  .result-card {
    padding: 2.4rem 1.8rem;
  }

  .result-image-wrap {
    width: 24rem;
    height: 24rem;
  }
}
