:root{
  --bg:#f5f7ff;
  --card:rgba(255,255,255,.72);
  --card2:rgba(255,255,255,.86);
  --text:#0c1222;
  --muted:#4b5875;
  --brand:#0ea5e9;
  --ok:#0f9d58;
  --bad:#e11d48;
  --border:rgba(12,18,34,.12);
  --shadow: 0 12px 40px rgba(12,18,34,.10);
  --glass: blur(10px);
}

html[data-theme="dark"]{
  --bg:#0b1020;
  --card:rgba(15,23,51,.55);
  --card2:rgba(18,28,61,.65);
  --text:#e9eeff;
  --muted:#a9b3d6;
  --brand:#6ee7ff;
  --ok:#43f3a6;
  --bad:#ff5a7a;
  --border:rgba(255,255,255,.10);
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --glass: blur(10px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(14,165,233,.18), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(15,157,88,.12), transparent 55%),
    var(--bg);
  color:var(--text);
}
html[data-theme="dark"] body{
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(110,231,255,.15), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(67,243,166,.12), transparent 55%),
    var(--bg);
}

a{color:inherit;text-decoration:none}
.container{max-width:1060px;margin:0 auto;padding:22px}

.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;border:1px solid var(--border);
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius:18px;
  box-shadow: var(--shadow);
}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.3px}

/* Wide SVG logo (5:1) */
.brandLogoWide{
  height: 38px;
  width: auto;
  display:block;
}
.brandLogoSquare{
  height: 34px;
  width: 34px;
  display:none;
  object-fit: contain;
}

@media (max-width: 800px){
  .brandLogoWide{ display:none; }
  .brandLogoSquare{ display:block; }
}

.authLogoWide{
  height: 54px;
  width: auto;
  display:block;
  max-width: 320px;
}
@media (max-width: 520px){
  .authLogoWide{ height: 44px; max-width: 260px; }
}


.brand-badge{
  width:34px;height:34px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(14,165,233,.20), rgba(15,157,88,.12));
  border:1px solid var(--border);
}
.brand-badge img{width:22px;height:22px;display:block}
html[data-theme="dark"] .brand-badge{
  background: linear-gradient(135deg, rgba(110,231,255,.25), rgba(67,243,166,.18));
}

.nav{display:flex;gap:10px;align-items:center}
.nav a{
  padding:10px 12px;border-radius:12px;border:1px solid transparent;
  color:var(--muted);font-weight:650;font-size:14px;
}
.nav a.active, .nav a:hover{
  border-color:var(--border);
  background: var(--card2);
  color:var(--text);
}

.card{
  border:1px solid var(--border);
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius:22px;
  padding:18px;
  box-shadow: var(--shadow);
}

.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:18px;align-items:stretch;margin-top:18px}
.hero h1{margin:0;font-size:34px;line-height:1.05}
.hero p{margin:10px 0 0;color:var(--muted);font-size:15px;line-height:1.5}

.ctaRow{display:flex;gap:12px;flex-wrap:wrap;margin-top:16px}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  padding:12px 14px;border-radius:14px;border:1px solid var(--border);
  background: var(--card2);
  color:var(--text);
  font-weight:750;font-size:14px;
  cursor:pointer;
}
.btn.primary{
  border-color: rgba(14,165,233,.35);
  background: linear-gradient(135deg, rgba(14,165,233,.18), rgba(15,157,88,.10));
}
html[data-theme="dark"] .btn.primary{
  border-color: rgba(110,231,255,.35);
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(67,243,166,.14));
}
.btn.danger{
  border-color: rgba(225,29,72,.32);
  background: linear-gradient(135deg, rgba(225,29,72,.12), rgba(225,29,72,.06));
}
html[data-theme="dark"] .btn.danger{
  border-color: rgba(255,90,122,.35);
  background: linear-gradient(135deg, rgba(255,90,122,.18), rgba(255,90,122,.08));
}

.grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:12px;
  margin-top:16px;
}
@media (max-width: 980px){ .grid{grid-template-columns: repeat(3, minmax(0, 1fr));} .hero{grid-template-columns:1fr} }
@media (max-width: 640px){ .grid{grid-template-columns: repeat(2, minmax(0, 1fr));} }

.level{
  padding:14px;border-radius:18px;border:1px solid var(--border);
  background: var(--card2);
  min-height:118px;
  display:flex;flex-direction:column;gap:8px;
}
.level .title{font-weight:850}

.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--border);
  background: var(--card);
  font-size:12px;color:var(--muted);font-weight:700;
  width:max-content;
}
.pill.ok{color:var(--ok);border-color: rgba(15,157,88,.35);background: rgba(15,157,88,.08)}
.pill.bad{color:var(--bad);border-color: rgba(225,29,72,.35);background: rgba(225,29,72,.07)}
.pill.lock{color:var(--muted);opacity:.75}
html[data-theme="dark"] .pill.ok{border-color: rgba(67,243,166,.35);background: rgba(67,243,166,.08)}
html[data-theme="dark"] .pill.bad{border-color: rgba(255,90,122,.35);background: rgba(255,90,122,.07)}

.stageGrid{display:grid;grid-template-columns: repeat(5, minmax(0, 1fr));gap:clamp(10px, 1.2vw, 14px);margin-top:14px}

/* En pantallas >700px: 1 fila / 10 columnas (manteniendo el mismo HTML/JS) */
@media (min-width: 701px){
  .stageGrid{grid-template-columns: repeat(10, minmax(0, 1fr));}
}
.stageBtn{
  width:100%;
  aspect-ratio: 1 / 1;
  padding:10px 10px;border-radius:14px;border:1px solid var(--border);
  background: var(--card2);
  font-weight:800;font-size:13px;text-align:center;
  display:flex;align-items:flex-start;justify-content:center;
  position:relative;
  overflow:visible;
}
.stageBtn.ok{border-color: rgba(15,157,88,.35);background: rgba(15,157,88,.08);color:var(--ok)}
.stageBtn.bad{border-color: rgba(225,29,72,.35);background: rgba(225,29,72,.07);color:var(--bad)}
html[data-theme="dark"] .stageBtn.ok{border-color: rgba(67,243,166,.35);background: rgba(67,243,166,.08)}
html[data-theme="dark"] .stageBtn.bad{border-color: rgba(255,90,122,.35);background: rgba(255,90,122,.07)}
.stageBtn.locked{opacity:.55}

/* Animaciones sutiles al desbloquear/superar etapas (se activan por JS cuando llega el mensaje final) */
.stageBtn.unlockPulse{animation: dmUnlockPulse 1.25s ease-out 1; will-change: transform;}
.stageBtn.completePop{animation: dmCompletePop .75s cubic-bezier(.2,1.4,.3,1) 1; will-change: transform;}
@keyframes dmUnlockPulse{
  0%{transform:scale(1); box-shadow:0 0 0 0 rgba(59,130,246,0);} 
  20%{transform:scale(1.02); box-shadow:0 0 0 10px rgba(59,130,246,.14);} 
  100%{transform:scale(1); box-shadow:0 0 0 0 rgba(59,130,246,0);} 
}
@keyframes dmCompletePop{
  0%{transform:scale(1);} 
  30%{transform:scale(1.03);} 
  60%{transform:scale(.99);} 
  100%{transform:scale(1);} 
}
@media (prefers-reduced-motion: reduce){
  .stageBtn.unlockPulse,.stageBtn.completePop{animation:none !important;}
}

/* Confeti pequeño al desbloquear (se inserta por JS sobre el botón desbloqueado) */
.dmConfettiWrap{
  position:absolute;
  left:50%;
  top:50%;
  width:0;
  height:0;
  pointer-events:none;
  z-index:5;
}
.dmConfettiPiece{
  position:absolute;
  left:0;
  top:0;
  width:6px;
  height:10px;
  border-radius:2px;
  background: var(--c, #60a5fa);
  opacity:1;
  transform: translate(-50%, -50%) rotate(var(--rot0, 0deg));
  animation: dmConfetti var(--dur, 900ms) cubic-bezier(.15,.9,.25,1) forwards;
  animation-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}
@keyframes dmConfetti{
  0%{ opacity:1; transform: translate(-50%, -50%) rotate(var(--rot0, 0deg)); }
  100%{ opacity:0; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, -60px))) rotate(var(--rot1, 540deg)); }
}
@media (prefers-reduced-motion: reduce){
  .dmConfettiWrap{display:none !important;}
}

.stageBtnInner{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;line-height:1.1;width:100%;padding-top:2px}
.stageTitleLine{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:800}
.stageScore{font-weight:500;font-size:12px;opacity:.9}
.stageLabel{display:inline-block}
.ticketIcon{margin:0;font-size:.98em;vertical-align:middle}
.stageBtn.ok .ticketIcon{color:var(--ok)}
.stageBtn.bad .ticketIcon{color:var(--muted)}
.stageBtn.locked .ticketIcon{color:var(--muted);opacity:.85}

/* Botones de etapas en /desarrollo/: 3 lineas (Etapa / Icono / Puntaje) */
.stageBtn.quizStageBtn{
  /* center content both directions and scale better on large screens */
  align-items:center;
  justify-content:center;
  /* un poco más pequeño para evitar que el texto se vea gigante */
  font-size: clamp(13px, 1.15vw, 18px);
  /* En /desarrollo/ el texto debe seguir el tema (negro/ blanco). */
  color: var(--text);
}
.stageBtn.quizStageBtn .stageBtnInner{
  height:100%;
  justify-content:center;
  align-items:center;
  padding-top:0;
  gap: clamp(8px, 1.0vw, 12px);
}
.stageBtn.quizStageBtn .stageLine1{
  font-weight:850;
  font-size: .95em;
  color: var(--text);
}
.stageBtn.quizStageBtn .stageLine2{
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.stageBtn.quizStageBtn .stageIcon{
  /* icono más protagonista, pero sin exagerar */
  font-size: clamp(22px, 2.6vw, 44px);
}
.stageBtn.quizStageBtn .stageLine3{
  font-weight:500;
  font-size: .9em;
  opacity:.9;
  min-height: 1.25em;
  color: var(--text);
}
.stageBtn.quizStageBtn .stageLine3.placeholder{
  visibility:hidden;
}
.stageBtn.ok .stageIcon{color:var(--ok)}
.stageBtn.bad .stageIcon{color:var(--muted)}
.stageBtn.locked .stageIcon{color:var(--muted);opacity:.85}

/* Evitar que el estado ok/bad pinte el texto (solo el ícono debe llevar color) */
.stageBtn.quizStageBtn.ok,
.stageBtn.quizStageBtn.bad{color: var(--text);}

/*
  Ajuste fino para 10 columnas y pantallas intermedias/ancho:
  - Usa unidades de Container Query (cqw) para que texto e ícono dependan del ancho del botón,
    no del viewport.
  - Mantiene límites (min/max) para evitar que crezca demasiado en pantallas grandes.
  - Evita recortes (sin overflow ocultando contenido).
*/
@supports (container-type: inline-size){
  .stageBtn.quizStageBtn{
    container-type: inline-size;
    overflow: visible;
    padding: clamp(6px, 6cqw, 10px);
  }
  .stageBtn.quizStageBtn .stageBtnInner{
    gap: clamp(4px, 7cqw, 11px);
  }
  .stageBtn.quizStageBtn .stageLine1{
    font-size: clamp(10px, 14cqw, 16px);
    line-height: 1.15;
    white-space: nowrap;
  }
  .stageBtn.quizStageBtn .stageIcon{
    font-size: clamp(16px, 32cqw, 40px);
    line-height: 1;
  }
  .stageBtn.quizStageBtn .stageLine3{
    font-size: clamp(10px, 12cqw, 13px);
    line-height: 1.15;
    min-height: 0;
  }
}


.quizH{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.quizH h2{margin:0;font-size:22px}
.muted{color:var(--muted)}
.small{font-size:13px}
.code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:12px;
  background: rgba(0,0,0,.06);
  padding:2px 6px;border-radius:8px;border:1px solid var(--border);
}
html[data-theme="dark"] .code{background: rgba(0,0,0,.25)}

.qCard{margin-top:12px;padding:14px;border-radius:18px;border:1px solid var(--border);background: var(--card2)}
.qTitle{font-weight:850;margin:0 0 10px;font-size:18px;line-height:1.3}
.opts{display:grid;gap:8px}
.opt{
  padding:10px 12px;border-radius:14px;border:1px solid var(--border);
  background: rgba(0,0,0,.03);
  display:flex;gap:10px;align-items:flex-start;
}
html[data-theme="dark"] .opt{background: rgba(15,23,51,.45)}
.opt input{margin-top:3px}

.notice{
  margin-top:14px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid var(--border);
  background: var(--card);
}
.notice.ok{border-color: rgba(15,157,88,.35);background: rgba(15,157,88,.08)}
.notice.bad{border-color: rgba(225,29,72,.35);background: rgba(225,29,72,.07)}
html[data-theme="dark"] .notice.ok{border-color: rgba(67,243,166,.35);background: rgba(67,243,166,.08)}
html[data-theme="dark"] .notice.bad{border-color: rgba(255,90,122,.35);background: rgba(255,90,122,.07)}

.footerRow{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}

.toggle{
  display:inline-flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:14px;border:1px solid var(--border);
  background: var(--card2);
  color:var(--text);
  font-weight:800;font-size:13px;
}

.footerRow.right{justify-content:flex-end}

/* Quiz single-page + animations */
.qa-shell{margin-top:12px}
.qa-panel{position:relative; overflow:hidden}
.qa-slide{transition: transform .22s ease, opacity .22s ease}
.qa-slide.out{opacity:0; transform: translateX(-10px)}
.qa-slide.in{opacity:0; transform: translateX(10px)}
.qa-slide.show{opacity:1; transform: translateX(0)}
.opt{cursor:pointer}
.opt.disabled{opacity:.65; cursor:not-allowed}
.opt.correct{border-color: rgba(15,157,88,.45); background: rgba(15,157,88,.10)}
.opt.wrong{border-color: rgba(225,29,72,.45); background: rgba(225,29,72,.10)}
html[data-theme="dark"] .opt.correct{border-color: rgba(67,243,166,.40); background: rgba(67,243,166,.10)}
html[data-theme="dark"] .opt.wrong{border-color: rgba(255,90,122,.40); background: rgba(255,90,122,.10)}
.footerRow.right{justify-content:flex-end}
.btn.icon i{font-size:14px}
.stageBtn.locked{opacity:.45; pointer-events:none}
.resultWrap{margin-top:14px; display:grid; gap:12px}
.resultCard{
  border:1px solid var(--border);
  background: var(--card2);
  border-radius:22px;
  padding:18px;
  box-shadow: var(--shadow);
}
.resultTop{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}
.resultIcon{
  width:54px; height:54px; border-radius:18px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  background: linear-gradient(135deg, rgba(14,165,233,.16), rgba(15,157,88,.10));
  font-size:22px;
}
.resultIcon.bad{
  background: linear-gradient(135deg, rgba(225,29,72,.12), rgba(225,29,72,.06));
}
html[data-theme="dark"] .resultIcon{
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(67,243,166,.14));
}
html[data-theme="dark"] .resultIcon.bad{
  background: linear-gradient(135deg, rgba(255,90,122,.18), rgba(255,90,122,.08));
}
.scorePill{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:16px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.04);
  font-weight:900;
}
html[data-theme="dark"] .scorePill{background: rgba(0,0,0,.22)}
.scorePill .n{font-size:18px}
.spin{animation: spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Current stage highlight (visible in light/dark) */
.stageBtn.current{
  border-color: rgba(14,165,233,.65);
  background: linear-gradient(135deg, rgba(14,165,233,.20), rgba(15,157,88,.10));
  color: var(--text);
  box-shadow: 0 10px 28px rgba(14,165,233,.16);
  position: relative;
}
html[data-theme="dark"] .stageBtn.current{
  border-color: rgba(110,231,255,.60);
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(67,243,166,.14));
  box-shadow: 0 10px 28px rgba(110,231,255,.14);
}

/* Improve button contrast in dark mode */
html[data-theme="dark"] .btn{
  background: rgba(18,28,61,.72);
  border-color: rgba(255,255,255,.14);
}
html[data-theme="dark"] .btn.primary{
  background: linear-gradient(135deg, rgba(110,231,255,.24), rgba(67,243,166,.16));
  border-color: rgba(110,231,255,.38);
}

/* Level accent colors (motivational) */
.level{position:relative; overflow:hidden}
.level:before{
  content:"";
  position:absolute; inset:-1px -1px auto -1px;
  height:6px;
  background: rgba(14,165,233,.35);
}
.level .accentTag{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--border);
  background: var(--card);
  font-size:12px; font-weight:800;
  width:max-content;
}
.level .accentDot{
  width:10px; height:10px; border-radius:999px;
  background: rgba(14,165,233,.8);
  box-shadow: 0 0 0 4px rgba(14,165,233,.10);
}

.level.accent-1:before{background: linear-gradient(90deg,#0ea5e9,#22c55e);}
.level.accent-2:before{background: linear-gradient(90deg,#8b5cf6,#ec4899);}
.level.accent-3:before{background: linear-gradient(90deg,#f59e0b,#ef4444);}
.level.accent-4:before{background: linear-gradient(90deg,#06b6d4,#3b82f6);}
.level.accent-5:before{background: linear-gradient(90deg,#10b981,#84cc16);}
.level.accent-6:before{background: linear-gradient(90deg,#f97316,#fb7185);}
.level.accent-7:before{background: linear-gradient(90deg,#6366f1,#22d3ee);}
.level.accent-8:before{background: linear-gradient(90deg,#e11d48,#a855f7);}
.level.accent-9:before{background: linear-gradient(90deg,#14b8a6,#f43f5e);}
.level.accent-10:before{background: linear-gradient(90deg,#facc15,#38bdf8);}

.level.accent-1 .accentDot{background:#0ea5e9; box-shadow:0 0 0 4px rgba(14,165,233,.12)}
.level.accent-2 .accentDot{background:#8b5cf6; box-shadow:0 0 0 4px rgba(139,92,246,.12)}
.level.accent-3 .accentDot{background:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.12)}
.level.accent-4 .accentDot{background:#06b6d4; box-shadow:0 0 0 4px rgba(6,182,212,.12)}
.level.accent-5 .accentDot{background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.12)}
.level.accent-6 .accentDot{background:#f97316; box-shadow:0 0 0 4px rgba(249,115,22,.12)}
.level.accent-7 .accentDot{background:#6366f1; box-shadow:0 0 0 4px rgba(99,102,241,.12)}
.level.accent-8 .accentDot{background:#e11d48; box-shadow:0 0 0 4px rgba(225,29,72,.12)}
.level.accent-9 .accentDot{background:#14b8a6; box-shadow:0 0 0 4px rgba(20,184,166,.12)}
.level.accent-10 .accentDot{background:#facc15; box-shadow:0 0 0 4px rgba(250,204,21,.12)}

/* Dark mode: stage buttons (pending/unlocked) must stand out */
html[data-theme="dark"] .stageBtn{
  background: rgba(255,255,255,.06);
  border-color: rgba(110,231,255,.22);
  color: rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
}
html[data-theme="dark"] .stageBtn:hover{
  background: rgba(255,255,255,.09);
  border-color: rgba(110,231,255,.34);
}
html[data-theme="dark"] .stageBtn:active{
  transform: translateY(1px);
}
html[data-theme="dark"] .stageBtn.locked{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.10);
  color: rgba(255,255,255,.58);
  box-shadow: none;
}

/* Stats dashboard */
.statsGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
@media (max-width: 980px){
  .statsGrid{grid-template-columns: repeat(2, minmax(0,1fr));}
}
@media (max-width: 560px){
  .statsGrid{grid-template-columns: 1fr;}
}
.statCard{
  border:1px solid var(--border);
  background: var(--card2);
  border-radius:22px;
  padding:16px;
  display:flex;
  gap:12px;
  align-items:flex-start;
  box-shadow: var(--shadow);
}
.statIcon{
  width:44px;height:44px;border-radius:16px;
  display:grid;place-items:center;
  border:1px solid var(--border);
  background: rgba(14,165,233,.12);
  font-size:18px;
  flex: 0 0 auto;
}
html[data-theme="dark"] .statIcon{background: rgba(110,231,255,.14);}
.statLabel{font-size:12px;font-weight:800;letter-spacing:.2px;color:var(--muted)}
.statValue{font-size:26px;font-weight:950;line-height:1.1;margin-top:2px}
.statHint{margin-top:6px;font-size:12px;color:var(--muted)}
.progressBar{
  margin-top:14px;
  height:12px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.04);
  overflow:hidden;
}
html[data-theme="dark"] .progressBar{background: rgba(0,0,0,.22);}
.progressFill{
  height:100%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(14,165,233,.9), rgba(34,197,94,.9));
  width:0%;
  transition: width .35s ease;
}
.levelsStats{margin-top:14px; display:grid; gap:12px;}
.levelStatLink{display:block; color:inherit; text-decoration:none}
.levelStatLink .levelStat{transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease}
.levelStatLink:hover .levelStat{transform:translateY(-1px); box-shadow: var(--shadow)}
.levelStatLink:focus-visible{outline:none}
.levelStatLink:focus-visible .levelStat{box-shadow:0 0 0 3px rgba(14,165,233,.25), var(--shadow); border-color: rgba(14,165,233,.35)}
.levelStat{padding:14px}
.levelStat .row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.04);
  font-weight:900; font-size:12px;
}
.pill .chev{opacity:.7; display:inline-flex; align-items:center}
html[data-theme="dark"] .pill{background: rgba(0,0,0,.22);}
.pill.ok{border-color: rgba(15,157,88,.35); background: rgba(15,157,88,.10);}
html[data-theme="dark"] .pill.ok{border-color: rgba(67,243,166,.28); background: rgba(67,243,166,.12);}
.pill .chev{display:inline-flex; align-items:center; margin-left:6px; opacity:.75}
.miniBar{
  margin-top:10px;
  height:10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.04);
  overflow:hidden;
}
html[data-theme="dark"] .miniBar{background: rgba(0,0,0,.22);}
.miniFill{
  height:100%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(14,165,233,.85), rgba(34,197,94,.85));
  width:0%;
}
.stageMiniGrid{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(10, 1fr);
  gap:6px;
}
.stageMiniGrid .mini{
  height:10px;
  border-radius:6px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.05);
}
html[data-theme="dark"] .stageMiniGrid .mini{background: rgba(255,255,255,.05);}
.stageMiniGrid .mini.ok{background: rgba(15,157,88,.28); border-color: rgba(15,157,88,.30);}
.stageMiniGrid .mini.bad{background: rgba(225,29,72,.22); border-color: rgba(225,29,72,.30);}
.stageMiniGrid .mini.none{opacity:.55}

/* Estadísticas por nivel */
.levelDetailTop{margin-top:8px}
.levelDetailMeta{display:flex; flex-direction:column; gap:8px}
.stageStatsGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 820px){
  .stageStatsGrid{grid-template-columns: 1fr}
}
.stageStatCard{
  border:1px solid var(--border);
  background: var(--card2);
  border-radius:22px;
  padding:14px;
  box-shadow: var(--shadow);
}
.stageStatCard.none{opacity:.85}
.stageStatCard.ok{border-color: rgba(15,157,88,.30)}
.stageStatCard.bad{border-color: rgba(225,29,72,.28)}
.stageStatCard .topRow{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap}
.stageStatCard .title{font-weight:950}
.scoreRow{margin-top:10px; display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap}
.scoreBig{font-size:30px; font-weight:950; line-height:1}
.scoreBig .muted{font-size:.55em; font-weight:900}
.scoreSplit{font-size:12px; color: var(--muted); display:grid; gap:4px}
.scoreSplit strong{color: var(--text); font-weight:950}

/* Landing */
.landingHero{
  margin-top:16px;
  border:1px solid var(--border);
  background: radial-gradient(1200px 520px at 10% 10%, rgba(14,165,233,.22), transparent 55%),
              radial-gradient(900px 480px at 90% 25%, rgba(34,197,94,.18), transparent 55%),
              var(--card2);
  border-radius:28px;
  padding:22px;
  box-shadow: var(--shadow);
}
.landingTop{display:flex; align-items:flex-start; justify-content:space-between; gap:18px; flex-wrap:wrap}
.landingTitle{display:flex; gap:14px; align-items:flex-start}
.brandMark{
  width:54px; height:54px; border-radius:18px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  background: rgba(14,165,233,.14);
  font-size:22px;
  box-shadow: 0 10px 24px rgba(14,165,233,.12);
  flex:0 0 auto;
}
html[data-theme="dark"] .brandMark{background: rgba(110,231,255,.14); box-shadow: 0 10px 24px rgba(110,231,255,.10);}
.landingHero h1{margin:0; font-size:34px; letter-spacing:-.5px}
.pillRow{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.pillMini{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.04);
  font-weight:900; font-size:12px;
}
html[data-theme="dark"] .pillMini{background: rgba(255,255,255,.05);}
.landingStats{display:flex; align-items:center; gap:14px}
.ring{
  width:92px; height:92px; border-radius:999px;
  border:1px solid var(--border);
  background: conic-gradient(from 220deg, rgba(14,165,233,.9) 0%, rgba(34,197,94,.85) 48%, rgba(14,165,233,.18) 70%, rgba(14,165,233,.18) 100%);
  display:grid; place-items:center;
  box-shadow: 0 14px 30px rgba(0,0,0,.16);
}
html[data-theme="dark"] .ring{box-shadow: 0 14px 30px rgba(0,0,0,.35);}
.ringInner{
  width:68px; height:68px; border-radius:999px;
  border:1px solid var(--border);
  background: var(--card);
  display:grid; place-items:center;
  text-align:center;
  padding-top:4px;
}
.ringValue{font-size:22px; font-weight:950; line-height:1}
.ringLabel{font-size:11px; font-weight:900; color:var(--muted); margin-top:-2px}
.miniFacts{display:grid; gap:8px}
.miniFact{display:flex; gap:10px; align-items:baseline}
.miniFact .k{font-size:18px; font-weight:950}
.miniFact .t{font-size:12px; color:var(--muted); font-weight:900; letter-spacing:.2px}
.landingGrid{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
@media (max-width: 920px){ .landingGrid{grid-template-columns: 1fr;} }
.featureCard{
  display:flex; align-items:center; gap:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius:22px;
  padding:14px 14px;
  text-decoration:none;
  color:inherit;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}
html[data-theme="dark"] .featureCard{background: rgba(255,255,255,.03); box-shadow: 0 12px 26px rgba(0,0,0,.28);}
.featureCard:hover{transform: translateY(-2px); border-color: rgba(110,231,255,.30)}
.featureCard .icon{
  width:46px; height:46px; border-radius:18px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  background: rgba(14,165,233,.12);
  font-size:18px;
  flex:0 0 auto;
}
.featureCard .txt .h{font-weight:950; letter-spacing:-.2px}
.featureCard .txt .s{font-size:12px; color:var(--muted); margin-top:2px; font-weight:700}
.featureCard .go{margin-left:auto; opacity:.75}
.featureCard.accentA .icon{background: rgba(34,197,94,.14)}
.featureCard.accentB .icon{background: rgba(139,92,246,.14)}
.featureCard.accentC .icon{background: rgba(245,158,11,.14)}


/* Top nav: icons + responsive labels */
.nav a, .nav button.toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.nav i{font-size:14px}
@media (max-width: 800px){
  .nav .navText{display:none;}
  .nav a, .nav button.toggle{
    gap:0;
    padding:10px 12px;
    min-width:44px;
    justify-content:center;
  }
}

@media (max-width: 560px){
  
}

/* Landing CTA alignment */
.landingCta{
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  width:100%;
}
@media (max-width: 560px){
  .landingCta{justify-content:center;}
}

/* Rolling numbers: keep them crisp */
[data-roll]{ font-variant-numeric: tabular-nums; }

/* ---------------- PWA Install Banner ---------------- */
.dmInstallWrap{
  max-width:1060px;
  margin:0 auto;
  padding:0 22px 22px;
}

.dmInstallBar{
  position: static;
  width: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-top: 18px;
  border: 1px solid var(--border);
  background: var(--card2);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.dmInstallBar__left{ display:flex; flex-direction:column; gap:4px; }
.dmInstallBar__title{
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}
.dmInstallBar__title i{
  margin-right: 8px;
  color: var(--primary);
}
.dmInstallBar__text{
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
}
.dmInstallBar__actions{ display:flex; gap:8px; align-items:center; }
.dmInstallBar__actions .btn i{ margin-right: 8px; }

@media (max-width: 520px){
  .dmInstallBar{ padding: 10px 10px; }
  .dmInstallBar__text{ font-size: 13px; }
}

.dmIosInstall{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.55);
}
.dmIosInstall__card{
  width: min(420px, 100%);
  border: 1px solid var(--border);
  background: var(--card2);
  backdrop-filter: var(--glass);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.dmIosInstall__title{
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}
.dmIosInstall__body{ color: var(--muted); font-size: 14px; line-height: 1.35; }
.dmIosInstall__actions{ margin-top: 14px; display:flex; justify-content:flex-end; }

/* Feedback below options */
.fbWrap{ margin-top:14px; }
.fbCard{
  display:flex; gap:12px; align-items:flex-start;
  border:1px solid var(--border);
  border-radius:18px;
  padding:12px 12px;
  background: rgba(255,255,255,.02);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  animation: fbIn .16s ease-out;
}
html[data-theme="dark"] .fbCard{ box-shadow: 0 12px 26px rgba(0,0,0,.28); background: rgba(255,255,255,.03); }
.fbCard.ok{ border-color: rgba(34,197,94,.35); }
.fbCard.bad{ border-color: rgba(239,68,68,.35); }
.fbIcon{
  width:40px; height:40px; border-radius:14px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  flex:0 0 auto;
  background: rgba(14,165,233,.12);
}
.fbCard.ok .fbIcon{ background: rgba(34,197,94,.16); }
.fbCard.bad .fbIcon{ background: rgba(239,68,68,.12); }
.fbTitle{ font-weight:950; letter-spacing:-.2px; font-size:14px; }
.fbExp{
  margin-top:6px;
  color: var(--muted);
  font-weight:700;
  font-size:13px;
  line-height:1.25;
  display:flex; gap:8px; align-items:flex-start;
}
.fbExp i{ margin-top:2px; opacity:.9; }
@keyframes fbIn{ from{ transform: translateY(-2px); opacity:.0 } to{ transform: translateY(0); opacity:1 } }

/* Landing lead */
.landingLead{
  margin-top:14px;
  padding:14px 14px;
  border:1px solid var(--border);
  border-radius:20px;
  background: rgba(255,255,255,.02);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}
html[data-theme="dark"] .landingLead{
  background: rgba(255,255,255,.03);
  box-shadow: 0 12px 26px rgba(0,0,0,.28);
}
.landingLeadP{
  font-weight:750;
  color: var(--text);
  line-height:1.25;
}
.landingLeadP strong{font-weight:950}
.landingLeadMeta{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.04);
  font-weight:900;
  font-size:12px;
  color: var(--text);
}
html[data-theme="dark"] .chip{background: rgba(255,255,255,.05);}

.primaryCard{
  border-color: rgba(110,231,255,.28);
  background: radial-gradient(700px 220px at 10% 10%, rgba(14,165,233,.16), transparent 60%),
              rgba(255,255,255,.02);
}
html[data-theme="dark"] .primaryCard{
  background: radial-gradient(700px 220px at 10% 10%, rgba(110,231,255,.14), transparent 60%),
              rgba(255,255,255,.03);
}
@media (min-width: 921px){
  .landingGrid .primaryCard{grid-column: span 2;}
}

/* Landing grid: avoid empty space on desktop */
@media (min-width: 921px){
  .landingGrid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .landingGrid .primaryCard{ grid-column: span 2; }
}


/* ===== Auth (Login / Registro) ===== */
.authCard{
  max-width: 520px;
  margin: 28px auto 0;
  padding: 26px 22px 18px;
  border-radius: 24px;
  border:1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.authLogo{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin-bottom: 20px;
}
.authMark{
  width:58px;height:58px;
  border-radius: 18px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(236,72,153,.9), rgba(14,165,233,.9));
  color:#fff;
  box-shadow: 0 18px 35px rgba(0,0,0,.12);
}
.authMark i{ font-size: 22px; }
.authBrand{
  font-weight: 850;
  letter-spacing: -.02em;
  font-size: 32px;
}
.authTitle{
  margin-top: 6px;
  text-align:center;
  font-weight: 800;
  font-size: 18px;
}
.authMuted{
  text-align:center;
  color: var(--muted);
  font-size: 14px;
}
.googleBtn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 14px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  color: var(--text);
  text-decoration:none;
  font-weight: 750;
}
html.dark .googleBtn{ background: rgba(255,255,255,.08); }
.gIcon{
  width:28px;height:28px;border-radius:999px;
  display:grid;place-items:center;
  background: rgba(255,255,255,.9);
  border:1px solid rgba(0,0,0,.06);
}
html.dark .gIcon{ background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.12); }
.gIcon i{ font-size: 14px; color:#111; }
html.dark .gIcon i{ color:#fff; }

.orRow{
  margin: 18px 0 14px;
  position:relative;
  text-align:center;
  color: var(--muted);
  font-weight: 700;
}
.orRow:before,.orRow:after{
  content:"";
  position:absolute;
  top:50%;
  width:44%;
  height:1px;
  background: var(--border);
}
.orRow:before{ left:0; }
.orRow:after{ right:0; }
.orRow span{
  display:inline-block;
  padding: 0 10px;
  background: transparent;
}

.authForm{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.authInput{
  width:100%;
  padding: 16px 18px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.5);
  color: var(--text);
  outline: none;
  font-weight: 650;
}
html.dark .authInput{ background: rgba(255,255,255,.06); }
.authInput::placeholder{ color: rgba(100,116,139,.9); font-weight: 650; }
html.dark .authInput::placeholder{ color: rgba(148,163,184,.85); }


.authField{ position:relative; width:100%; }
.fakePh{
  position:absolute;
  left:18px;
  top:50%;
  transform:translateY(-50%);
  color: rgba(100,116,139,.9);
  font-weight: 650;
  pointer-events:none;
  transition: opacity .15s ease;
}
html.dark .fakePh{ color: rgba(148,163,184,.85); }
.authField.isFilled .fakePh,
.authField.isFocus .fakePh{ opacity:0; }
.authInputDate{ padding-right: 46px; } /* espacio para icono date en algunos navegadores */

.pwRow{ position:relative; }
.pwToggle{
  position:absolute;
  right:10px; top:50%;
  transform: translateY(-50%);
  width:40px;height:40px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.35);
  color: var(--muted);
  cursor:pointer;
}
html.dark .pwToggle{ background: rgba(255,255,255,.06); }

.authLinks{
  margin-top: -2px;
  text-align:right;
  font-weight: 650;
}
.authLinks a{
  color: var(--muted);
  text-decoration:none;
}
.authLinks a:hover{ text-decoration: underline; }

.authBtn{
  width:100%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 16px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.45);
  color: var(--text);
  text-decoration:none;
  font-weight: 850;
  cursor:pointer;
}
html.dark .authBtn{ background: rgba(255,255,255,.06); }
.authBtnPrimary{
  background: linear-gradient(135deg, rgba(14,165,233,.9), rgba(236,72,153,.9));
  border-color: rgba(14,165,233,.18);
  color:#fff;
  box-shadow: 0 20px 36px rgba(0,0,0,.14);
}
.authBtnGhost{
  background: rgba(255,255,255,.35);
}
html.dark .authBtnGhost{ background: rgba(255,255,255,.06); }

.authFooter{
  margin-top: 14px;
  text-align:center;
  color: var(--muted);
  font-weight: 650;
}
.authFooter a{
  color: var(--text);
  text-decoration:none;
  font-weight: 850;
}
.authFooter a:hover{ text-decoration: underline; }
.authFooter .sep{ margin: 0 8px; color: var(--muted); }

.authError{
  margin: 10px 0 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,.28);
  background: rgba(239,68,68,.10);
  color: rgba(239,68,68,.95);
  font-weight: 750;
  text-align:center;
}

.stepDots{
  display:flex;
  justify-content:center;
  gap:8px;
  margin: 8px 0 10px;
}
.stepDots .dot{
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(148,163,184,.55);
  border: 1px solid rgba(148,163,184,.35);
}
.stepDots .dot.active{
  background: rgba(14,165,233,.9);
  border-color: rgba(14,165,233,.35);
  box-shadow: 0 0 0 4px rgba(14,165,233,.14);
}
.stepDots .dot.done{
  background: rgba(67,243,166,.75);
  border-color: rgba(67,243,166,.35);
}

.authBack{
  display:block;
  margin-top: 8px;
  text-align:center;
  color: var(--muted);
  text-decoration:none;
  font-weight: 750;
}
.authBack:hover{ text-decoration: underline; }

@media (max-width: 520px){
  .authCard{ margin-top: 14px; padding: 22px 16px 16px; border-radius: 20px; }
  .authBrand{ font-size: 28px; }
}


/* Google button mount */
.googleMount{
  width:100%;
  display:flex;
  justify-content:center;
  border-radius: 999px;
  overflow:hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.10);
}
.googleMount{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
}
/* Botón Google: dejamos que Google controle el tamaño/estilo oficial (sin forzar ancho del iframe) */
.googleMount > div{
  display:flex;
  justify-content:center;
}

/* Google custom button (no iframe) */
.dmGoogleCustomBtn{
  width:100%;
  height:56px;
  border:2px solid rgba(70,70,70,.55);
  border-radius:999px;
  background:rgba(255,255,255,.88);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  font-weight:800;
  color:#111827;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .18s ease, background .18s ease;
}
[data-theme="dark"] .dmGoogleCustomBtn{ background:rgba(10,10,10,.35); color:#f3f4f6; border-color:rgba(200,200,200,.45); }
.dmGoogleCustomBtn:hover{ transform:translateY(-1px); box-shadow:0 18px 45px rgba(0,0,0,.16); }
.dmGoogleCustomBtn:active{ transform:translateY(0); box-shadow:0 10px 25px rgba(0,0,0,.14); }
.dmGoogleCustomBtn .gIcon{
  width:22px; height:22px; flex:0 0 22px;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="%23EA4335" d="M24 9.5c3.5 0 6.6 1.2 9.1 3.5l6.8-6.8C35.9 2.3 30.3 0 24 0 14.6 0 6.6 5.4 2.6 13.2l8.2 6.4C12.7 13.7 17.9 9.5 24 9.5z"/><path fill="%234285F4" d="M46.1 24.5c0-1.6-.2-3.1-.5-4.5H24v8.6h12.3c-.6 3-2.3 5.6-4.9 7.3l7.5 5.8c4.4-4.1 7.2-10.2 7.2-17.2z"/><path fill="%23FBBC05" d="M10.8 28.6c-.5-1.5-.8-3-.8-4.6 0-1.6.3-3.1.8-4.6l-8.2-6.4C.9 16.4 0 20.1 0 24c0 3.9.9 7.6 2.6 10.9l8.2-6.3z"/><path fill="%2334A853" d="M24 48c6.3 0 11.6-2.1 15.5-5.8l-7.5-5.8c-2.1 1.4-4.8 2.3-8 2.3-6.1 0-11.3-4.1-13.1-9.7l-8.2 6.3C6.6 42.6 14.6 48 24 48z"/></svg>');
  background-size:contain;
  background-repeat:no-repeat;
  background-position:center;
}
/* Modal (confirmar reinicio de etapa) */
.dmModal{position:fixed;inset:0;z-index:9999;}
.dmModalOverlay{position:absolute;inset:0;background:rgba(0,0,0,.62);}

/* Restart modal backdrop must cover full viewport without rounded corners */
#dmRestartModal{border-radius:0 !important;overflow:visible !important;}
#dmRestartModal .dmModalOverlay{border-radius:0 !important;}

.dmModalCard{position:relative;margin:min(10vh,96px) auto 0;width:calc(100% - 32px);max-width:860px;padding:26px 26px 20px;border-radius:26px;border:1px solid var(--border);background:var(--card2);box-shadow:0 30px 90px rgba(0,0,0,.25);}
/* Modal typography: keep it readable on mobile but not huge on desktop */
.dmModalCard h1{margin:0 0 12px;font-size:clamp(20px,2.2vw,32px);line-height:1.12;letter-spacing:-.4px;}
.dmModalCard p{margin:0;color:var(--muted);font-size:clamp(13px,1.2vw,16px);line-height:1.55;}
.dmModalActions{display:flex;gap:14px;margin-top:22px;flex-wrap:wrap;justify-content:flex-end;align-items:center;}
.dmModalActions .btn{min-width:150px;}
@media (max-width:480px){
  .dmModalActions{flex-direction:column;align-items:flex-end;}
  .dmModalActions .btn{width:min(220px,100%);min-width:0;}
}

/* --------------------------------------------------------------------------
   Estadisticas: revision de etapa (preguntas + respuestas)
---------------------------------------------------------------------------*/

.stageReviewTop{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}
.stageReviewMeta{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.stageReviewMeta .pill{white-space:nowrap}

.reviewList{margin-top:14px;display:grid;gap:12px}
.reviewCard{border:1px solid var(--border);border-radius:16px;background:rgba(255,255,255,.72);box-shadow:var(--shadow);padding:14px;opacity:0;transform:translateY(8px) scale(.99);transition:opacity .36s ease, transform .36s ease}
html[data-theme='dark'] .reviewCard{background:rgba(0,0,0,.26)}
.reviewCard.reveal{opacity:1;transform:translateY(0) scale(1)}
.reviewQTop{display:flex;gap:10px;align-items:flex-start;justify-content:space-between}
.reviewQNum{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:12px;background:rgba(14,165,233,.14);border:1px solid rgba(14,165,233,.22);font-weight:900}
.reviewQTitle{font-weight:950;font-size:16px;line-height:1.25}
.reviewBadge{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:999px;font-weight:900;border:1px solid var(--border);background:rgba(0,0,0,.04)}
html[data-theme='dark'] .reviewBadge{background:rgba(255,255,255,.06)}
.reviewBadge.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.12)}
.reviewBadge.bad{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.12)}

.reviewOpts{margin-top:12px;display:grid;gap:8px}
.reviewOpt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:14px;border:1px solid var(--border);background:rgba(0,0,0,.02);position:relative;overflow:hidden}
html[data-theme='dark'] .reviewOpt{background:rgba(255,255,255,.05)}
.reviewOpt .tag{flex:0 0 auto;width:26px;height:26px;border-radius:10px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);background:rgba(0,0,0,.04);font-weight:900}
html[data-theme='dark'] .reviewOpt .tag{background:rgba(255,255,255,.06)}
.reviewOpt .txt{flex:1 1 auto}
.reviewOpt .mark{flex:0 0 auto;opacity:.85}

.reviewOpt.correct{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.12)}
.reviewOpt.correct .tag{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.15)}
.reviewOpt.picked{box-shadow:0 0 0 3px rgba(14,165,233,.18) inset}
.reviewOpt.picked.badpick{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.10)}
.reviewOpt.picked.badpick .tag{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.12)}

.reviewExplain{margin-top:12px;display:grid;gap:10px}
.reviewExplain .exp{border:1px solid var(--border);border-radius:14px;padding:12px;background:rgba(0,0,0,.02)}
html[data-theme='dark'] .reviewExplain .exp{background:rgba(255,255,255,.05)}
.reviewExplain .exp.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.10)}
.reviewExplain .exp.bad{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.10)}
.reviewExplain .lbl{font-weight:950;margin-bottom:6px;display:flex;gap:8px;align-items:center}

.stageStatCard.clickable{cursor:pointer;text-decoration:none}
.stageStatCard.clickable:hover{transform:translateY(-2px);transition:transform .18s ease}
.stageStatCard .viewReview{margin-top:10px;display:flex;justify-content:flex-end}
.stageStatCard .viewReview .miniBtn{font-size:12px;font-weight:900;padding:8px 10px;border-radius:12px;border:1px solid var(--border);background:rgba(14,165,233,.08)}
html[data-theme='dark'] .stageStatCard .viewReview .miniBtn{background:rgba(14,165,233,.14)}


/* Compat: clases usadas en la pagina de revision */
.reviewTop{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:12px}
.reviewScore{display:inline-flex;align-items:center;gap:10px;padding:10px 12px;border-radius:999px;border:1px solid var(--border);background:rgba(0,0,0,.03);font-weight:950}
html[data-theme='dark'] .reviewScore{background:rgba(255,255,255,.06)}
.reviewScore .n{font-size:20px}
.reviewAttempts{margin-top:12px}
.attemptPills{display:flex;gap:8px;flex-wrap:wrap}
.attemptPill{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:999px;border:1px solid var(--border);background:rgba(0,0,0,.03);font-weight:900;text-decoration:none;color:inherit}
html[data-theme='dark'] .attemptPill{background:rgba(255,255,255,.06)}
.attemptPill.active{border-color:rgba(14,165,233,.45);box-shadow:0 0 0 3px rgba(14,165,233,.16) inset}

.reviewQCard{border:1px solid var(--border);border-radius:16px;background:rgba(255,255,255,.72);box-shadow:var(--shadow);padding:14px;opacity:0;transform:translateY(8px) scale(.99);transition:opacity .36s ease, transform .36s ease}
html[data-theme='dark'] .reviewQCard{background:rgba(0,0,0,.26)}
.reviewQCard.reveal{opacity:1;transform:translateY(0) scale(1)}
.reviewQHead{display:flex;gap:12px;align-items:flex-start;justify-content:space-between}
.reviewQHead .qNum{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:12px;background:rgba(14,165,233,.14);border:1px solid rgba(14,165,233,.22);font-weight:950}
.reviewQHead .qText{flex:1 1 auto;font-weight:950;font-size:16px;line-height:1.25}
.reviewQHead .qBadge{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:999px;font-weight:900;border:1px solid var(--border);background:rgba(0,0,0,.04)}
html[data-theme='dark'] .reviewQHead .qBadge{background:rgba(255,255,255,.06)}
.reviewQHead .qBadge.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.12)}
.reviewQHead .qBadge.bad{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.12)}

.reviewOpts{margin-top:12px;display:grid;gap:8px}
.reviewOpts .opt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:14px;border:1px solid var(--border);background:rgba(0,0,0,.02);position:relative;overflow:hidden}
html[data-theme='dark'] .reviewOpts .opt{background:rgba(255,255,255,.05)}
.reviewOpts .optKey{flex:0 0 auto;width:26px;height:26px;border-radius:10px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);background:rgba(0,0,0,.04);font-weight:950}
html[data-theme='dark'] .reviewOpts .optKey{background:rgba(255,255,255,.06)}
.reviewOpts .optText{flex:1 1 auto}
.reviewOpts .optIcon{flex:0 0 auto;opacity:.9}
.reviewOpts .opt.correct{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.12)}
.reviewOpts .opt.correct .optKey{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.15)}
.reviewOpts .opt.picked{box-shadow:0 0 0 3px rgba(14,165,233,.18) inset}
.reviewOpts .opt.picked.bad{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.10)}
.reviewOpts .opt.picked.bad .optKey{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.12)}

.reviewExp{margin-top:12px}
.reviewExp .expBox{border:1px solid var(--border);border-radius:14px;padding:12px;background:rgba(0,0,0,.02);font-weight:700}
html[data-theme='dark'] .reviewExp .expBox{background:rgba(255,255,255,.05)}
.reviewExp .expBox.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.10)}
.reviewExp .expBox.bad{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.10)}

/* ==========================================================================
   CURSO2 MODERN UI OVERRIDE - minimal, rápido, mobile-first
   ========================================================================== */

:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --card2:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --brand:#2563eb;
  --brand2:#1d4ed8;
  --ok:#16a34a;
  --bad:#dc2626;
  --warn:#d97706;
  --border:#e2e8f0;
  --shadow:0 1px 2px rgba(15,23,42,.05);
  --shadow2:0 8px 24px rgba(15,23,42,.06);
  --glass:none;
  --radius:16px;
}

html[data-theme="dark"]{
  --bg:#0b1120;
  --card:#111827;
  --card2:#0f172a;
  --text:#f8fafc;
  --muted:#94a3b8;
  --brand:#60a5fa;
  --brand2:#3b82f6;
  --ok:#22c55e;
  --bad:#f87171;
  --warn:#fbbf24;
  --border:#1f2937;
  --shadow:0 1px 2px rgba(0,0,0,.25);
  --shadow2:0 8px 24px rgba(0,0,0,.22);
}

html,body{
  min-height:100%;
  background:var(--bg) !important;
}

body{
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  color:var(--text);
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.container{
  width:min(1120px, 100%);
  margin:0 auto;
  padding:20px;
}

.topbar{
  border:1px solid var(--border) !important;
  background:var(--card) !important;
  backdrop-filter:none !important;
  box-shadow:var(--shadow) !important;
  border-radius:18px !important;
  padding:12px 14px !important;
}

.brand{
  gap:12px;
  font-weight:850;
}

.brandLogoWide{
  height:34px;
}

.brandLogoSquare{
  height:34px;
  width:34px;
}

.nav{
  gap:6px;
}

.nav a{
  border:0 !important;
  background:transparent !important;
  color:var(--muted) !important;
  border-radius:10px !important;
  padding:9px 10px !important;
  font-weight:700 !important;
}

.nav a.active,
.nav a:hover{
  background:#eef2ff !important;
  color:var(--brand2) !important;
}

html[data-theme="dark"] .nav a.active,
html[data-theme="dark"] .nav a:hover{
  background:#172554 !important;
  color:#bfdbfe !important;
}

.card,
.level,
.stageBtn,
.stat,
.notice,
.authBox,
.modalBox{
  background:var(--card) !important;
  border:1px solid var(--border) !important;
  box-shadow:var(--shadow) !important;
  backdrop-filter:none !important;
}

.card{
  border-radius:20px !important;
  padding:20px !important;
}

.hero{
  gap:16px !important;
  margin-top:16px !important;
}

.hero h1{
  font-size:clamp(28px, 5vw, 48px) !important;
  letter-spacing:-.04em;
  line-height:1.02 !important;
}

.hero p,
.muted{
  color:var(--muted) !important;
}

.btn,
button,
input,
select,
textarea{
  font:inherit;
}

.btn{
  min-height:44px;
  border-radius:12px !important;
  border:1px solid var(--border) !important;
  background:var(--card2) !important;
  color:var(--text) !important;
  box-shadow:none !important;
  font-weight:800 !important;
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}

.btn:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1 !important;
}

.btn.primary{
  border-color:var(--brand) !important;
  background:var(--brand) !important;
  color:#fff !important;
}

.btn.primary:hover{
  background:var(--brand2) !important;
}

.btn.danger{
  border-color:#fecaca !important;
  background:#fef2f2 !important;
  color:#b91c1c !important;
}

html[data-theme="dark"] .btn.danger{
  border-color:#7f1d1d !important;
  background:#2a1111 !important;
  color:#fecaca !important;
}

.grid{
  gap:14px !important;
}

.level{
  border-radius:18px !important;
  padding:16px !important;
  min-height:126px;
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.level:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow2) !important;
  border-color:#cbd5e1 !important;
}

.level .title{
  font-size:16px;
  letter-spacing:-.01em;
}

.pill{
  background:#f8fafc !important;
  border:1px solid var(--border) !important;
  color:var(--muted) !important;
  box-shadow:none !important;
}

.pill.ok{
  color:#15803d !important;
  background:#f0fdf4 !important;
  border-color:#bbf7d0 !important;
}

.pill.bad{
  color:#b91c1c !important;
  background:#fef2f2 !important;
  border-color:#fecaca !important;
}

html[data-theme="dark"] .pill{
  background:#0f172a !important;
}

.stageGrid{
  gap:10px !important;
}

.stageBtn{
  border-radius:14px !important;
  background:var(--card) !important;
  color:var(--text) !important;
  box-shadow:none !important;
}

.stageBtn:hover:not(.locked){
  border-color:var(--brand) !important;
  box-shadow:var(--shadow2) !important;
}

.stageBtn.current{
  border-color:var(--brand) !important;
  outline:3px solid rgba(37,99,235,.12);
}

.stageBtn.ok{
  background:#f0fdf4 !important;
  border-color:#bbf7d0 !important;
  color:#15803d !important;
}

.stageBtn.bad{
  background:#fef2f2 !important;
  border-color:#fecaca !important;
  color:#b91c1c !important;
}

.stageBtn.locked{
  background:#f8fafc !important;
  color:#94a3b8 !important;
  opacity:1 !important;
}

html[data-theme="dark"] .stageBtn.locked{
  background:#0f172a !important;
  color:#64748b !important;
}

.quizBox,
.questionBox,
.option,
.answerOption,
.optionBtn,
.choice,
.choiceBtn{
  border-radius:16px !important;
}

.option,
.answerOption,
.optionBtn,
.choice,
.choiceBtn{
  background:var(--card) !important;
  border:1px solid var(--border) !important;
  box-shadow:none !important;
}

.option:hover,
.answerOption:hover,
.optionBtn:hover,
.choice:hover,
.choiceBtn:hover{
  border-color:var(--brand) !important;
}

input,
select,
textarea{
  border:1px solid var(--border) !important;
  background:var(--card) !important;
  color:var(--text) !important;
  border-radius:12px !important;
  box-shadow:none !important;
}

input:focus,
select:focus,
textarea:focus{
  outline:3px solid rgba(37,99,235,.16) !important;
  border-color:var(--brand) !important;
}

.notice{
  border-radius:16px !important;
  padding:14px 16px !important;
}

.progress,
.progressBar,
.bar{
  border-radius:999px !important;
  overflow:hidden;
}

.footerRow{
  gap:10px !important;
}

i.fa-solid,
i.fa-regular,
i.fa-brands{
  opacity:.88;
}

@media (max-width:700px){
  .container{
    padding:12px;
  }

  .topbar{
    position:sticky;
    top:8px;
    z-index:50;
    border-radius:16px !important;
  }

  .nav a{
    padding:8px !important;
    font-size:13px !important;
  }

  .card{
    padding:16px !important;
    border-radius:18px !important;
  }

  .hero{
    margin-top:12px !important;
  }

  .ctaRow,
  .footerRow{
    display:grid !important;
    grid-template-columns:1fr;
  }

  .btn{
    width:100%;
  }

  .grid{
    grid-template-columns:1fr !important;
  }

  .stageGrid{
    grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
    gap:8px !important;
  }

  .stageBtn{
    border-radius:12px !important;
    padding:8px 4px !important;
  }
}

@media (prefers-reduced-motion: reduce){
  *{
    animation:none !important;
    transition:none !important;
    scroll-behavior:auto !important;
  }
}

/* FIX GLOBAL: centrar Font Awesome dentro de cajas cuadradas */
.dmxAccountCardTop > i,
.dmxTileIcon > i,
.dmxHeroIcon > i,
.dmxFeedbackIcon > i,
.dmxResultIcon > i,
.dmxSuccessIcon > i,
.statIcon > i,
.fbIcon > i,
.authMark > i,
.gIcon > i,
.resultIcon > i{
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  line-height:1 !important;
  overflow:hidden !important;
}

.dmxAccountCardTop > i::before,
.dmxTileIcon > i::before,
.dmxHeroIcon > i::before,
.dmxFeedbackIcon > i::before,
.dmxResultIcon > i::before,
.dmxSuccessIcon > i::before,
.statIcon > i::before,
.fbIcon > i::before,
.authMark > i::before,
.gIcon > i::before,
.resultIcon > i::before{
  position:absolute !important;
  inset:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:100% !important;
  margin:0 !important;
  line-height:1 !important;
  text-align:center !important;
  transform:none !important;
}
