:root {
  --ink: #263050;
  --muted: #727997;
  --purple: #7b61ff;
  --purple-dark: #6147eb;
  --yellow: #ffd76a;
  --pink: #ff91b8;
  --mint: #79dfc1;
  --paper: rgba(255, 255, 255, 0.93);
  --shadow: 0 28px 80px rgba(68, 55, 132, 0.18);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", "Noto Sans SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 215, 106, .55), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(255, 145, 184, .36), transparent 26%),
    radial-gradient(circle at 78% 86%, rgba(121, 223, 193, .38), transparent 25%),
    linear-gradient(145deg, #f8f2ff, #eef7ff 48%, #fff5ed);
  overflow-x: hidden;
}

button { font: inherit; }

.background-shapes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.shape { position: absolute; border-radius: 999px; filter: blur(1px); animation: drift 8s ease-in-out infinite; }
.shape-one { width: 95px; height: 95px; left: 8%; top: 16%; background: var(--yellow); opacity: .42; }
.shape-two { width: 125px; height: 125px; right: 7%; top: 26%; background: var(--pink); opacity: .26; animation-delay: -3s; }
.shape-three { width: 80px; height: 80px; right: 14%; bottom: 8%; background: var(--mint); opacity: .45; animation-delay: -6s; }

.app-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-content: center;
  padding: 40px 20px 24px;
}

.quiz-card {
  position: relative;
  width: min(100%, 660px);
  min-height: 620px;
  padding: 54px 64px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 36px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.decorative-stars { position: absolute; right: 28px; top: 22px; color: var(--yellow); font-size: 30px; animation: spin 5s linear infinite; }
.screen { display: none; min-height: 510px; }
.screen.active { display: flex; flex-direction: column; animation: appear .5s ease both; }
#start-screen, #result-screen { align-items: center; justify-content: center; text-align: center; }

.hero-icon {
  width: 128px; height: 108px; margin-bottom: 25px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 50% 44% 48% 42%; background: #eee9ff; color: var(--purple);
  font-size: 25px; transform: rotate(-3deg); animation: float 3s ease-in-out infinite;
}
.hero-icon span:nth-child(2) { font-size: 52px; transform: rotate(3deg); }
.hero-icon span:first-child { color: var(--pink); transform: translateY(-28px); }
.hero-icon span:last-child { color: var(--yellow); transform: translateY(29px); }

.eyebrow { margin: 0 0 13px; color: var(--purple); font-size: 12px; font-weight: 900; letter-spacing: 2.8px; }
h1 { margin: 0; font-size: clamp(42px, 8vw, 66px); line-height: 1.07; letter-spacing: -2.4px; }
h1 span { position: relative; color: var(--purple); }
h1 span::after { content: ""; position: absolute; height: 7px; left: 3px; right: 0; bottom: 2px; z-index: -1; border-radius: 99px; background: var(--yellow); transform: rotate(-2deg); }
.subtitle { max-width: 400px; margin: 23px 0 29px; color: var(--muted); font-size: 17px; line-height: 1.75; }

.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 15px;
  min-width: 200px; padding: 16px 27px; border: 0; border-radius: 17px;
  color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 12px 25px rgba(123, 97, 255, .3); font-weight: 900; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.primary-button:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 30px rgba(123, 97, 255, .38); }
.primary-button:active { transform: translateY(0) scale(.98); }
.time-hint { margin: 18px 0 0; color: #9da2b8; font-size: 12px; font-weight: 700; }

.progress-header { display: flex; align-items: center; height: 36px; color: var(--muted); font-weight: 800; font-size: 13px; }
.back-button { width: 36px; height: 36px; margin-right: 13px; border: 0; border-radius: 12px; color: var(--ink); background: #f1eff9; cursor: pointer; transition: transform .2s, background .2s; }
.back-button:hover { transform: translateX(-2px); background: #e9e5fa; }
.progress-percent { margin-left: auto; color: var(--purple); }
.progress-track { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: #eeecf5; }
.progress-fill { width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.question-content { padding-top: 36px; }
.question-content.switching { animation: slideIn .4s ease both; }
.question-emoji { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 19px; background: #fff3c9; font-size: 28px; transform: rotate(-3deg); }
.question-content h2 { margin: 0 0 30px; font-size: clamp(25px, 5vw, 35px); line-height: 1.35; letter-spacing: -.7px; }
.answers { display: grid; gap: 13px; }
.answer-button {
  width: 100%; display: flex; align-items: center; gap: 15px; padding: 15px 18px;
  text-align: left; color: var(--ink); border: 2px solid #eeecf5; border-radius: 17px; background: #fff;
  font-weight: 800; cursor: pointer; transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
.answer-letter { flex: 0 0 auto; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: var(--purple); background: #f0edff; font-weight: 900; transition: color .2s, background .2s; }
.answer-button:hover, .answer-button.selected { transform: translateX(5px); border-color: var(--purple); background: #faf9ff; box-shadow: 0 8px 20px rgba(93, 77, 166, .09); }
.answer-button:hover .answer-letter, .answer-button.selected .answer-letter { color: #fff; background: var(--purple); }

.result-icon { width: 105px; height: 105px; display: grid; place-items: center; margin: 5px 0 18px; border-radius: 35px; background: #ebfff9; font-size: 53px; animation: resultPop .7s cubic-bezier(.2,1.4,.4,1) both, float 3s 1s ease-in-out infinite; }
.result-kicker { margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; }
#result-title { margin: 5px 0 2px; font-size: clamp(35px, 7vw, 49px); line-height: 1.2; color: var(--ink); }
.result-english { margin: 0 0 22px; color: var(--purple); font-weight: 900; letter-spacing: 1px; }
.result-description { max-width: 465px; padding: 18px 22px; border-radius: 18px; color: #626a87; background: #f8f6ff; line-height: 1.75; }
.trait-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 25px; }
.trait { padding: 7px 13px; border-radius: 99px; color: #6a52df; background: #eeeaff; font-size: 12px; font-weight: 900; }
.confetti i { position: absolute; width: 8px; height: 16px; top: -18px; border-radius: 4px; animation: fall 2.8s ease-in infinite; }
.confetti i:nth-child(1) { left: 9%; background: var(--pink); animation-delay: -.4s; }
.confetti i:nth-child(2) { left: 21%; background: var(--yellow); animation-delay: -1.2s; }
.confetti i:nth-child(3) { left: 35%; background: var(--mint); animation-delay: -.7s; }
.confetti i:nth-child(4) { left: 48%; background: var(--purple); animation-delay: -2s; }
.confetti i:nth-child(5) { left: 60%; background: var(--pink); animation-delay: -1.7s; }
.confetti i:nth-child(6) { left: 72%; background: var(--yellow); animation-delay: -.2s; }
.confetti i:nth-child(7) { left: 83%; background: var(--mint); animation-delay: -2.4s; }
.confetti i:nth-child(8) { left: 93%; background: var(--purple); animation-delay: -1s; }

footer { margin-top: 18px; color: rgba(55, 61, 91, .55); text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .4px; }

@keyframes appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes drift { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(18px,-18px) rotate(12deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes resultPop { from { opacity: 0; transform: scale(.45) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(650px) rotate(500deg); opacity: 0; } }

@media (max-width: 650px) {
  .app-shell { display: block; padding: 16px 12px 20px; }
  .quiz-card { min-height: calc(100vh - 58px); padding: 38px 23px; border-radius: 28px; }
  .screen { min-height: calc(100vh - 134px); }
  .question-content { padding-top: 30px; }
  .answer-button { padding: 13px; font-size: 14px; }
  .hero-icon { width: 110px; height: 95px; }
}

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