:root {
  --bg: #FFF6EC;
  --bg-2: #EAF7EF;
  --ink: #2B2340;
  --ink-soft: #6B6282;
  --card: #FFFFFF;
  --line: #EDE4DA;
  --ok: #2EAD6B;
  --ok-bg: #E3F7EC;
  --bad: #E5484D;
  --bad-bg: #FDE8E8;
  --accent: #FF7AA8;
  --accent-2: #8E6CEF;
  --career: #8E6CEF;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(60, 40, 90, .10), 0 2px 6px rgba(60, 40, 90, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 700px at 10% -10%, #FFE3EE 0%, transparent 60%),
              radial-gradient(1000px 700px at 110% 110%, #DDF3E6 0%, transparent 60%),
              linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
h1, h2, .chip, .btn-primary, .career-name { font-family: "Fredoka", "Nunito", sans-serif; }

/* ---------- pétalos ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.petal {
  position: absolute; top: -40px;
  font-size: var(--s, 22px);
  opacity: .55;
  animation: fall var(--d, 14s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes fall {
  0%   { transform: translate(0, -40px) rotate(0deg); }
  50%  { transform: translate(var(--drift, 60px), 55vh) rotate(180deg); }
  100% { transform: translate(0, 110vh) rotate(360deg); }
}

/* ---------- botones flotantes ---------- */
.icon-btn {
  position: fixed; top: 14px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.8);
  font-size: 20px; cursor: pointer; color: var(--ink-soft);
  backdrop-filter: blur(6px);
}
.fullscreen-btn { right: 14px; }
.sound-btn { right: 66px; }

/* ---------- pantallas ---------- */
.screen {
  display: none; position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  padding: 72px 16px 32px;
  max-width: 1100px; margin: 0 auto;
  flex-direction: column; align-items: center; justify-content: center;
}
.screen.active { display: flex; animation: enter .45s cubic-bezier(.2,.8,.2,1); }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- home ---------- */
.hero { text-align: center; margin-bottom: 28px; }
.badge {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-weight: 800; color: var(--ink-soft);
  box-shadow: var(--shadow);
}
h1 { font-size: clamp(48px, 9vw, 96px); margin: 14px 0 6px; line-height: 1; letter-spacing: -1px; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #2F9BD7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(17px, 2.2vw, 22px); color: var(--ink-soft); margin: 0; line-height: 1.45; }
.lead strong { color: var(--ink); }

.careers {
  width: 100%;
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
.career {
  --c: var(--career);
  position: relative; overflow: hidden;
  border: 0; cursor: pointer; text-align: left; font: inherit;
  padding: 22px 20px; min-height: 150px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .15s ease, box-shadow .15s ease;
  animation: pop .5s cubic-bezier(.2,.9,.3,1.3) both;
  animation-delay: calc(var(--i) * 60ms);
  color: var(--ink);
}
.career::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, white) 0%, #fff 70%);
}
.career::after {
  content: ""; position: absolute; right: -30px; bottom: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 30%, transparent);
}
.career > * { position: relative; z-index: 1; }
.career:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(60,40,90,.16); }
.career:active { transform: scale(.97); }
.career-emoji {
  font-size: 40px; width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  background: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 35%, transparent);
}
.career-name { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; margin-top: 14px; line-height: 1.15; }
.career-cta { font-weight: 800; font-size: 14px; color: color-mix(in srgb, var(--c) 80%, black); margin-top: 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- quiz ---------- */
.quiz-top {
  width: 100%; max-width: 820px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.link-btn {
  background: none; border: 0; color: var(--ink-soft); font: inherit; font-weight: 800;
  cursor: pointer; padding: 8px 4px;
}
.chip {
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 18px;
  background: color-mix(in srgb, var(--career) 18%, white);
  color: color-mix(in srgb, var(--career) 70%, black);
  border: 1px solid color-mix(in srgb, var(--career) 35%, white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dots { display: flex; gap: 8px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line);
  transition: all .3s ease;
}
.dot.current { border-color: var(--career); transform: scale(1.25); }
.dot.ok { background: var(--ok); border-color: var(--ok); }
.dot.bad { background: var(--bad); border-color: var(--bad); }

.card {
  width: 100%; max-width: 820px;
  background: var(--card); border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}
.question-card { border-top: 8px solid var(--career); }
.question-card.swap { animation: swap .4s cubic-bezier(.2,.8,.2,1); }
@keyframes swap { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.q-count { margin: 0 0 8px; font-weight: 800; color: var(--ink-soft); letter-spacing: .5px; text-transform: uppercase; font-size: 14px; }
.q-text { font-size: clamp(24px, 3.4vw, 36px); line-height: 1.2; margin: 0 0 24px; font-weight: 600; }

.options { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; min-height: 76px;
  border-radius: 18px; border: 2px solid var(--line);
  background: #fff; cursor: pointer; text-align: left;
  font: inherit; font-size: clamp(16px, 2vw, 20px); font-weight: 700; color: var(--ink);
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.option:hover:not(:disabled) { border-color: var(--career); background: color-mix(in srgb, var(--career) 6%, white); }
.option:active:not(:disabled) { transform: scale(.98); }
.option:disabled { cursor: default; }
.letter {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--career) 15%, white);
  color: color-mix(in srgb, var(--career) 75%, black);
  font-family: "Fredoka", sans-serif; font-weight: 700;
}
.option.correct { border-color: var(--ok); background: var(--ok-bg); animation: bounce .4s ease; }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .4s ease; }
.option.wrong .letter { background: var(--bad); color: #fff; }
.option.faded { opacity: .45; }
@keyframes bounce { 50% { transform: scale(1.03); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.feedback { min-height: 28px; margin: 18px 0 0; text-align: center; font-weight: 800; font-size: 20px; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

/* ---------- resultado ---------- */
.result-card { text-align: center; max-width: 640px; animation: pop .6s cubic-bezier(.2,.9,.3,1.3); }
.result-emoji { font-size: 88px; line-height: 1; }
.result-title { font-size: clamp(34px, 6vw, 56px); margin: 10px 0 4px; line-height: 1.05; }
.result-score { font-size: 22px; font-weight: 800; color: var(--ink-soft); margin: 0 0 14px; }
.result-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.result-dots .dot { width: 22px; height: 22px; }
.result-msg { font-size: 19px; color: var(--ink-soft); margin: 0 0 22px; line-height: 1.45; }
.prize {
  display: none; flex-direction: column; gap: 6px;
  margin: 0 auto 22px; padding: 18px 26px; border-radius: 22px;
  background: linear-gradient(135deg, #FFD36E, #FF8FB1);
  color: #3A1A2E; font-family: "Fredoka", sans-serif;
  box-shadow: 0 12px 30px rgba(255, 120, 150, .35);
  animation: pulse 1.6s ease-in-out infinite;
}
.prize span { font-size: clamp(26px, 4.5vw, 36px); font-weight: 700; }
.prize small { font-family: "Nunito", sans-serif; font-weight: 800; font-size: 15px; opacity: .8; }
.win .prize { display: flex; }
@keyframes pulse { 50% { transform: scale(1.04); } }

.btn-primary {
  border: 0; cursor: pointer;
  padding: 16px 34px; border-radius: 999px;
  font-size: 22px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 24px rgba(142, 108, 239, .35);
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(.97); }
.auto-return { margin: 14px 0 0; font-size: 14px; color: var(--ink-soft); min-height: 20px; }

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

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .careers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .screen { padding-top: 68px; }
  .careers { grid-template-columns: 1fr 1fr; gap: 12px; }
  .career { min-height: 128px; padding: 16px; }
  .career-emoji { font-size: 30px; width: 50px; height: 50px; border-radius: 14px; }
  .options { grid-template-columns: 1fr; }
  .option { min-height: 64px; }
  .quiz-top { flex-wrap: wrap; }
  .chip { order: 3; width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petals { display: none; }
}
