/* ---------- fondo con manchas de pintura ---------- */
.bg-paint { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; opacity: .55; }
.blob--y { width: 340px; height: 340px; background: var(--yellow); top: -140px; right: -120px; }
.blob--r { width: 220px; height: 220px; background: var(--red); bottom: -110px; left: -100px; }
.blob--b { width: 120px; height: 120px; background: var(--blue); bottom: 18%; right: -50px; }

.app {
  width: 100%; max-width: 720px; margin: 0 auto;
  min-height: 100dvh; padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.loading { flex: 1; display: grid; place-items: center; }

.screen { flex: 1; display: flex; flex-direction: column; animation: enter .45s var(--ease) both; }
.screen--back { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* ---------- bienvenida ---------- */
.welcome { justify-content: center; gap: 28px; padding: 12px 0 24px; }
.kicker {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 8px;
  padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--card); font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
}
.kicker i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: block; }
.hero-title { font-size: clamp(2.6rem, 11vw, 4.6rem); font-weight: 800; }
.hero-title .hl { background: var(--yellow); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero-title .hl--b { background: var(--blue); color: #fff; }
.hero-title .hl--r { background: var(--red); color: #fff; }
.hero-sub { margin: 14px 0 0; font-size: 1.1rem; color: var(--ink-2); max-width: 46ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem;
  border: 2px solid var(--ink); background: var(--card);
}
.chip b { font-family: var(--font-display); font-size: 1.05rem; }
.chip--y { background: var(--yellow); }
.chip--r { background: var(--red); color: #fff; }
.chip--b { background: var(--blue); color: #fff; }

.card {
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.start-card { display: grid; gap: 16px; }
.start-card .btn { width: 100%; min-height: 58px; font-size: 1.1rem; }
.fineprint { margin: 0; font-size: .85rem; color: var(--ink-3); text-align: center; }

/* ---------- barra superior ---------- */
.topbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 22px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.counter span { color: var(--ink-3); font-weight: 600; }
.module-tag {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 12px 6px 6px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--mod, var(--yellow)); color: var(--mod-ink, var(--ink));
  font-weight: 800; font-size: .82rem;
}
.module-tag .num {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: .78rem;
}
.module-tag .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress { display: flex; gap: 3px; height: 10px; }
.progress .seg {
  flex: 1; border-radius: 3px; background: rgba(20, 17, 15, .12);
  transition: background .3s, transform .3s var(--ease);
}
.progress .seg.done { background: var(--c); }
.progress .seg.current { background: var(--ink); transform: scaleY(1.5); }

/* ---------- pregunta ---------- */
.question { gap: 20px; }
.q-text { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 5.4vw, 2rem); line-height: 1.15; letter-spacing: -0.015em; }
.options { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 64px; padding: 14px 16px; text-align: left;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); font-size: 1.02rem; font-weight: 600; line-height: 1.35;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s;
}
.option:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.option:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.option .letter {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 2.5px solid var(--ink); background: var(--paper); font-family: var(--font-display); font-weight: 800;
  transition: background .2s, color .2s;
}
.option.selected { background: var(--mod); color: var(--mod-ink); }
.option.selected .letter { background: var(--ink); color: #fff; }
.option.selected::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat;
  animation: pop .3s var(--ease);
}
.option.selected { padding-right: 48px; }
.option.pulse { animation: pulse .35s var(--ease); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes pulse { 50% { transform: scale(1.02); } }

.nav { display: flex; gap: 12px; justify-content: space-between; margin-top: auto; padding-top: 24px; }
.nav .btn { flex: 1; max-width: 220px; }
.nav .btn:only-child { margin-left: auto; }
.hint { text-align: center; font-size: .8rem; color: var(--ink-3); margin: 10px 0 0; }
@media (hover: none) { .hint { display: none; } }

/* ---------- intro de módulo ---------- */
.module-intro {
  justify-content: center; gap: 22px; padding: 28px 24px; margin: 8px 0;
  background: var(--mod); color: var(--mod-ink);
  border: 2.5px solid var(--ink); border-radius: 28px; box-shadow: 8px 8px 0 var(--ink);
}
.module-intro .big-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 26vw, 9rem); line-height: .85; }
.module-intro h2 { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 800; }
.module-intro p { margin: 0; font-weight: 600; opacity: .85; }
.module-intro .btn { align-self: flex-start; background: var(--ink); color: #fff; }

/* ---------- revisión ---------- */
.review { gap: 22px; }
.review h2 { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 10px; }
.bubble {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 2.5px solid var(--ink); border-radius: 14px; background: var(--c);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--c-ink, var(--ink));
  transition: transform .15s var(--ease);
}
.bubble:hover { transform: translateY(-2px); }
.bubble.missing { background: #fff; border-style: dashed; border-color: var(--red); color: var(--red); }
.review-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.review-legend span { display: inline-flex; align-items: center; gap: 6px; }
.review-legend i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); display: block; }

/* ---------- gracias / cerrado ---------- */
.done { justify-content: center; align-items: flex-start; gap: 18px; }
.done .stamp {
  display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%;
  background: var(--yellow); border: 3px solid var(--ink); box-shadow: var(--shadow);
  animation: stamp .6s var(--ease) both;
}
.done .stamp svg { width: 48px; height: 48px; }
.done h1 { font-size: clamp(2.6rem, 11vw, 4.2rem); font-weight: 800; }
.done p { margin: 0; font-size: 1.12rem; color: var(--ink-2); max-width: 40ch; }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 70% { transform: scale(.92) rotate(4deg); opacity: 1; } 100% { transform: none; } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

@media (min-width: 640px) {
  .app { padding-top: 40px; }
  .card { padding: 28px; }
  .options { gap: 14px; }
}
