:root {
  --orange: #ff6b00;
  --orange-dark: #df5700;
  --white: #ffffff;
  --charcoal: #1e1e24;
  --muted: #5e6472;
  --line: #eceef3;
  --bg: #f4f6fa;
  --card: #ffffff;
  --shadow: 0 16px 40px rgba(16, 23, 35, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--charcoal);
  background: linear-gradient(180deg, #f6f8fc 0%, #f2f4f9 100%);
  min-height: 100svh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}

.bg-glow-left {
  background: rgba(255, 107, 0, 0.18);
  left: -150px;
  top: -90px;
}

.bg-glow-right {
  background: rgba(255, 173, 110, 0.2);
  right: -140px;
  bottom: -120px;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100svh;
  padding: 1rem 1rem 1.2rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.brand {
  background: var(--charcoal);
  color: var(--white);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.social-proof {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  animation: pulseText 2.8s ease infinite;
}

.screen {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.screen.is-active {
  display: block;
  animation: fadeIn 280ms ease forwards;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#welcomeScreen.is-active,
#infoScreen.is-active,
#quizScreen.is-active {
  flex: 1;
  min-height: calc(100svh - 88px);
  display: flex;
  align-items: stretch;
}

.welcome-card,
.info-card,
.quiz-card {
  width: 100%;
}

#welcomeScreen .welcome-card {
  flex: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#quizScreen .quiz-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.quiz-ambient {
  position: absolute;
  inset: -20% -8% auto -8%;
  height: 72%;
  pointer-events: none;
  z-index: 0;
}

.ambient-blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
}

.blob-a {
  width: 210px;
  height: 210px;
  left: 6%;
  top: 12%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 107, 0, 0.34), rgba(255, 107, 0, 0.02) 72%);
  animation: blobDrift 6.8s ease-in-out infinite;
}

.blob-b {
  width: 230px;
  height: 230px;
  right: 2%;
  top: 24%;
  background: radial-gradient(circle at 55% 40%, rgba(255, 177, 130, 0.32), rgba(255, 177, 130, 0.04) 70%);
  animation: blobDriftAlt 7.4s ease-in-out infinite;
}

.ambient-ring {
  position: absolute;
  width: 180px;
  height: 180px;
  right: 16%;
  top: 10%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 107, 0, 0.27);
  animation: ringSpin 10s linear infinite;
}

.quiz-head,
.question-panel,
#nextBtn {
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--orange);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.9rem, 7vw, 2.9rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.4rem, 5.4vw, 2rem);
}

.subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 3.8vw, 1.13rem);
  margin-bottom: 1rem;
}

.particle-logo-wrap {
  position: relative;
  width: 100%;
  height: clamp(140px, 29vw, 220px);
  border-radius: 18px;
  background: radial-gradient(circle at 20% 20%, rgba(255, 107, 0, 0.2), rgba(255, 255, 255, 0.95) 58%);
  border: 1px solid #ffe1ce;
  overflow: hidden;
  margin-bottom: 0.95rem;
}

.particle-logo-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.floating-icons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.float-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.65rem 0.6rem;
  border-radius: 14px;
  background: #fff8f3;
  border: 1px solid #ffe0ca;
  animation: floatY 3s ease-in-out infinite;
}

.float-chip:nth-child(2) {
  animation-delay: 0.3s;
}

.float-chip:nth-child(3) {
  animation-delay: 0.55s;
}

.float-chip:nth-child(4) {
  animation-delay: 0.8s;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, #ff8f3d 100%);
  color: var(--white);
  box-shadow: 0 12px 24px rgba(255, 107, 0, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(255, 107, 0, 0.32);
}

.btn-secondary {
  background: #fff;
  color: var(--charcoal);
  border: 1px solid #dbe0ea;
}

.pulse {
  animation: pulseButton 1.9s ease-in-out infinite;
}

.field-label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.required {
  color: var(--orange);
}

.input {
  width: 100%;
  border: 1px solid #dce2ed;
  border-radius: 12px;
  padding: 0.78rem 0.82rem;
  font: inherit;
  color: var(--charcoal);
  margin-bottom: 0.85rem;
  background: #fff;
}

.input:focus {
  outline: none;
  border-color: #ffc094;
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12);
}

.file-input {
  padding: 0.55rem;
}

.image-preview-wrap {
  border: 1px dashed #d6deeb;
  border-radius: 14px;
  min-height: 106px;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  background: #fafbfd;
}

.image-preview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.image-placeholder {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.8rem;
}

.error-text {
  color: #d33b2d;
  min-height: 1.05rem;
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
}

.quiz-head {
  margin-bottom: 1rem;
}

.progress-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #eceff6;
  overflow: hidden;
}

.progress-fill {
  width: 14.285%;
  height: 100%;
  background: linear-gradient(90deg, #ff6b00, #ff9656);
  border-radius: 999px;
  transition: width 300ms ease, filter 300ms ease;
  animation: progressPulse 2.2s ease-in-out infinite;
}

.question-panel {
  transition: transform 260ms ease, opacity 260ms ease;
}

.question-panel.slide-out {
  opacity: 0;
  transform: translateX(-24px);
}

.question-panel.slide-in {
  opacity: 0;
  transform: translateX(24px);
}

.question-visual {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.question-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: #fff3eb;
  animation: iconBob 2.8s ease-in-out infinite;
}

.question-illustration {
  min-height: 58px;
  border: 1px solid #f2dccd;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8f4, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-illustration svg {
  width: 92%;
  height: 50px;
  animation: drawFloat 3.5s ease-in-out infinite;
}

.question-illustration.theme-money .money-note {
  animation: moneyFloat 2.6s ease-in-out infinite;
}

.question-illustration.theme-money .note-2 {
  animation-delay: 0.28s;
}

.question-illustration.theme-money .note-3 {
  animation-delay: 0.52s;
}

.question-illustration.theme-money .money-coin {
  transform-origin: center;
  animation: coinSpin 1.8s linear infinite;
}

.question-illustration.theme-money .coin-2 {
  animation-duration: 2.3s;
}

.question-illustration.theme-energy .energy-rocket {
  transform-origin: 110px 32px;
  animation: rocketBoost 1.7s ease-in-out infinite;
}

.question-illustration.theme-energy .energy-flame {
  transform-origin: 95px 46px;
  animation: flameFlicker 0.48s ease-in-out infinite;
}

.question-illustration.theme-energy .energy-star {
  animation: starPulse 1.8s ease-in-out infinite;
}

.question-illustration.theme-energy .star-2 {
  animation-delay: 0.35s;
}

.question-illustration.theme-energy .star-3 {
  animation-delay: 0.65s;
}

.question-illustration.theme-energy .energy-trail {
  stroke-dasharray: 18;
  animation: dashRun 1.25s linear infinite;
}

.question-illustration.theme-speed .speed-runner {
  animation: runnerMove 1.2s ease-in-out infinite;
}

.question-illustration.theme-speed .speed-bar-fill {
  animation: fastProgress 1.4s linear infinite;
}

.question-illustration.theme-speed .speed-lines {
  stroke-dasharray: 10 8;
  animation: dashRun 0.9s linear infinite;
}

.question-illustration.theme-skill .brain-link {
  stroke-dasharray: 8 7;
  animation: dashRun 1.6s linear infinite;
}

.question-illustration.theme-skill .brain-node {
  animation: nodePulse 1.4s ease-in-out infinite;
}

.question-illustration.theme-skill .n2 {
  animation-delay: 0.2s;
}

.question-illustration.theme-skill .n3 {
  animation-delay: 0.42s;
}

.question-illustration.theme-skill .n4 {
  animation-delay: 0.58s;
}

.question-illustration.theme-skill .n5 {
  animation-delay: 0.78s;
}

.question-illustration.theme-build .cal-days {
  animation: calendarSlide 3.2s ease-in-out infinite;
}

.question-illustration.theme-build .cal-marker {
  animation: calendarJump 3.2s ease-in-out infinite;
}

.question-illustration.theme-social .social-buddy {
  animation: buddyBounce 2.1s ease-in-out infinite;
}

.question-illustration.theme-social .b2 {
  animation-delay: 0.32s;
}

.question-illustration.theme-social .b3 {
  animation-delay: 0.64s;
}

.question-illustration.theme-social .social-chat {
  animation: chatPop 1.9s ease-in-out infinite;
}

.question-illustration.theme-ai .ai-robot {
  animation: aiFade 2.2s ease-in-out infinite;
}

.question-illustration.theme-ai .ai-tool {
  animation: toolRise 2.2s ease-in-out infinite;
}

.question-illustration.theme-ai .ai-signal {
  stroke-dasharray: 14 10;
  animation: dashRun 1.15s linear infinite;
}

.question-text {
  margin-bottom: 0.95rem;
  line-height: 1.25;
  font-size: clamp(1.2rem, 4.6vw, 1.6rem);
}

.answer-list {
  display: grid;
  gap: 0.62rem;
  margin-bottom: 1rem;
}

.answer-btn {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid #e5e9f3;
  background: #fff;
  color: var(--charcoal);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.8rem;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.answer-btn:hover {
  border-color: #ffc79f;
  background: #fff7f1;
}

.answer-btn.is-selected {
  border-color: #ff9f5f;
  background: #fff1e7;
  animation: choiceBounce 280ms ease;
}

.answer-btn.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 107, 0, 0.5);
  animation: answerFlash 360ms ease;
  pointer-events: none;
}

.answer-btn {
  position: relative;
  overflow: hidden;
}

#quizScreen.theme-money .ambient-ring {
  border-color: rgba(255, 130, 38, 0.34);
}

#quizScreen.theme-energy .blob-a {
  background: radial-gradient(circle at 30% 30%, rgba(255, 107, 0, 0.42), rgba(255, 107, 0, 0.03) 72%);
}

#quizScreen.theme-speed .blob-b {
  background: radial-gradient(circle at 55% 40%, rgba(255, 145, 81, 0.42), rgba(255, 145, 81, 0.04) 70%);
}

#quizScreen.theme-skill .ambient-ring {
  animation-duration: 7.8s;
}

#quizScreen.theme-build .blob-a,
#quizScreen.theme-build .blob-b {
  filter: blur(1px);
}

#quizScreen.theme-social .ambient-ring {
  border-style: dashed;
}

#quizScreen.theme-ai .blob-a {
  background: radial-gradient(circle at 30% 30%, rgba(255, 126, 33, 0.32), rgba(255, 126, 33, 0.02) 72%);
}

#quizScreen.theme-ai .blob-b {
  background: radial-gradient(circle at 55% 40%, rgba(255, 214, 187, 0.4), rgba(255, 214, 187, 0.04) 70%);
}

.result-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.score {
  margin-bottom: 0.35rem;
  font-size: clamp(2.3rem, 10.5vw, 3.6rem);
  line-height: 1;
}

.score-max {
  font-size: 1.1rem;
  color: var(--muted);
  margin-left: 0.25rem;
}

.category {
  margin-bottom: 0.45rem;
  color: var(--orange);
}

.personal-message,
.compare {
  color: #434a5a;
}

.badge-card {
  background: linear-gradient(155deg, #1f222e 0%, #2a2f3d 100%);
  color: #f6f8ff;
  border-color: rgba(255, 255, 255, 0.12);
}

.badge-brand {
  margin: 0;
  font-weight: 800;
  font-size: 1.2rem;
}

.badge-title {
  margin: 0.2rem 0 1rem;
  color: #d4dbf6;
}

.badge-content {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 0.8rem;
  align-items: center;
}

.badge-avatar,
.badge-avatar-fallback {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.badge-avatar {
  display: none;
  object-fit: cover;
}

.badge-avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.09);
}

.badge-lines p {
  margin: 0;
}

.badge-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.badge-category {
  margin-top: 0.2rem;
  color: #ffc49b;
  font-weight: 600;
}

.badge-score,
.badge-ig {
  margin-top: 0.2rem;
  color: #dde3fb;
  font-size: 0.93rem;
}

.badge-site {
  margin: 1rem 0 0.8rem;
  color: #ffd7bf;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.share-card,
.promo-card {
  margin-top: 1rem;
}

.share-card h3,
.promo-card h3 {
  margin-bottom: 0.5rem;
}

.share-card p,
.promo-card p {
  color: #4d5567;
  margin-bottom: 0.85rem;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.copy-message {
  min-height: 1.1rem;
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: #287a50;
}

@media (min-width: 780px) {
  .app {
    padding: 1.4rem 1.4rem 1.6rem;
  }

  .card {
    padding: 1.5rem;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    width: auto;
    min-width: 170px;
  }

  .welcome-card .btn,
  .info-card .btn,
  .quiz-card .btn,
  .badge-card .btn,
  .promo-card .btn {
    width: auto;
  }

  .quiz-card #nextBtn {
    display: block;
    margin-left: auto;
  }

  #welcomeScreen.is-active,
  #infoScreen.is-active,
  #quizScreen.is-active {
    min-height: calc(100svh - 102px);
    align-items: center;
  }

  .welcome-card,
  .info-card,
  .quiz-card {
    max-width: 860px;
    margin: 0 auto;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseButton {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes choiceBounce {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulseText {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

@keyframes blobDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(14px, -10px, 0) scale(1.08);
  }
}

@keyframes blobDriftAlt {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-16px, 12px, 0) scale(1.06);
  }
}

@keyframes ringSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes iconBob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

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

@keyframes progressPulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes answerFlash {
  0% {
    opacity: 0.7;
    transform: scale(0.97);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}

@keyframes moneyFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(-3deg);
  }
}

@keyframes coinSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rocketBoost {
  0%, 100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(8px) translateY(-3px) rotate(2deg);
  }
}

@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes starPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.45);
    opacity: 1;
  }
}

@keyframes dashRun {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -30;
  }
}

@keyframes runnerMove {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(84px);
  }
}

@keyframes fastProgress {
  0% {
    width: 20px;
  }
  55% {
    width: 120px;
  }
  100% {
    width: 20px;
  }
}

@keyframes nodePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes calendarSlide {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-40px);
  }
}

@keyframes calendarJump {
  0%, 15% {
    transform: translateX(0);
  }
  25%, 40% {
    transform: translateX(28px);
  }
  50%, 65% {
    transform: translateX(56px);
  }
  75%, 90% {
    transform: translateX(84px);
  }
  100% {
    transform: translateX(112px);
  }
}

@keyframes buddyBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes chatPop {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes aiFade {
  0%, 45% {
    opacity: 1;
    transform: translateY(0);
  }
  60%, 100% {
    opacity: 0.22;
    transform: translateY(2px);
  }
}

@keyframes toolRise {
  0%, 45% {
    opacity: 0.25;
    transform: translateY(4px) rotate(0deg);
  }
  60%, 100% {
    opacity: 1;
    transform: translateY(0) rotate(-8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
