:root {
  --bg1: #0f172a;
  --bg2: #020617;
  --ac1: #22d3ee;
  --ac2: #a78bfa;
  --ok: #10b981;
  --bad: #ef4444;
  --txt: #e5e7eb;
  --muted: #94a3b8;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--txt);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 10% 10%, #0b1222, transparent),
    radial-gradient(1200px 800px at 90% 20%, #0a0f1f, transparent),
    linear-gradient(120deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

/* Fondo animado */
.orbs span {
  position: absolute;
  width: 18vmin;
  height: 18vmin;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(167, 139, 250, .35), rgba(34, 211, 238, .15));
  filter: blur(12px);
  animation: drift var(--d) linear infinite;
  opacity: .6;
  left: var(--l);
  top: var(--t);
}

@keyframes drift {
  to {
    transform: translate3d(0, -120vh, 0) rotate(360deg);
  }
}

.wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 32px;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

header {
  text-align: center;
}

.brand{
  font-weight: 800;             /* Ideal en blanco sólido */
  letter-spacing: .5px;
  font-size: clamp(22px, 2vw, 28px);
  color: #fff;
  text-shadow: none;            /* evita halo */
}

/* Todo lo que esté en <em> tiene degradado */
.brand em{
  display:inline-block;         /* evita glitches del clip */
  font-weight: 700;             /* menos “gordo”, menos borroso */
  background: linear-gradient(90deg, var(--ac1), var(--ac2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent; /* necesario en WebKit */
  color: transparent;

  text-shadow: none;            /* quita empañado */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* contorno sutil para definición sin halo */
  -webkit-text-stroke: 0.3px rgba(0,0,0,0.18);
  paint-order: stroke fill;
  line-height: 1.1;             /* ayuda a la rasterización */
}



.sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: clamp(13px, 1.6vw, 14px);
}

.card {
  width: min(900px, 100%);
  background: rgba(2, 6, 23, .55);
  border: 1px solid rgba(148, 163, 184, .15);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pill {
  background: rgba(148, 163, 184, .14);
  border: 1px solid rgba(148, 163, 184, .22);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #cbd5e1;
}

.progress {
  flex: 1;
  height: 10px;
  background: rgba(148, 163, 184, .18);
  border-radius: 999px;
  overflow: hidden;
  min-width: 180px;
}

.bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ac1), var(--ac2));
  transition: width .35s ease;
}

.qnum {
  font-size: 13px;
  color: #cbd5e1;
}

.question {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  margin: 8px 2px 14px;
}

.options {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.opt {
  text-align: left;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(15, 23, 42, .55);
  padding: 14px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .06s ease, border-color .2s, background .2s, box-shadow .2s;
}

.opt:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, .55);
  box-shadow: 0 6px 20px rgba(167, 139, 250, .12);
}

.opt.correct {
  border-color: rgba(16, 185, 129, .6);
  background: rgba(16, 185, 129, .12);
}

.opt.wrong {
  border-color: rgba(239, 68, 68, .6);
  background: rgba(239, 68, 68, .12);
  animation: shake .25s linear;
}

@keyframes shake {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.explain {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: 14px;
  display: none;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.btn {
  border: 1px solid rgba(148, 163, 184, .3);
  background: rgba(148, 163, 184, .08);
  color: var(--txt);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .06s ease, background .2s, border-color .2s;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, .6);
}

.btn.primary {
  background: linear-gradient(90deg, var(--ac1), var(--ac2));
  border: none;
  color: #0b1222;
}

.btn.ghost {
  background: transparent;
}

.btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.result {
  text-align: center;
  padding: 10px 6px 6px;
}

.scorebig {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: .5px;
  margin: 2px 0 10px;
  background: linear-gradient(90deg, var(--ac1), var(--ac2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(148, 163, 184, .1);
  margin-bottom: 10px;
  font-weight: 700;
}

.note {
  color: #cbd5e1;
}

.trophy {
  width: 86px;
  height: 86px;
  margin: 8px auto 4px;
  display: none;
}

/* Confeti */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

.confetti i {
  position: absolute;
  width: 10px;
  height: 14px;
  background: linear-gradient(180deg, var(--ac1), var(--ac2));
  top: -10px;
  opacity: .9;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translate3d(var(--dx), 110vh, 0) rotate(720deg);
  }
}

footer {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding-bottom: 10px;
}

@media (min-width: 720px) {
  .options { grid-template-columns: 1fr 1fr; }
}



/* Mejorar contraste de texto en opciones */
.question { color: #f8fafc; }

.opt {
  color: #e5e7eb;                 /* texto claro explícito */
  background: rgba(15, 23, 42, .80);
  font-weight: 600;
}

.opt:disabled {
  color: #e5e7eb;                 /* no permitir que el navegador lo apague */
  opacity: 1;                     /* mantener legible */
}

.opt.correct,
.opt.wrong {
  color: #e5e7eb;                 /* texto visible en estados correcto/incorrecto */
}





.module-table .barWrap { height:8px; background:rgba(148,163,184,.18); border-radius:6px; overflow:hidden; }
.module-table .bar    { height:100%; width:0; background:linear-gradient(90deg,#22d3ee,#a78bfa); }
.module-table td.pct  { width:120px; }




/* ====== Resultado por módulos (barras animadas) ====== */
.module-table .barWrap {
  height: 8px;
  background: rgba(148,163,184,.18);
  border-radius: 6px;
  overflow: hidden;
}
.module-table .bar {
  height: 100%;
  width: 0; /* se anima desde 0 */
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  transition: width .8s ease;
}
.module-table td.pct { width: 140px; }

/* (Opcional) micro realce a los títulos del desglose */
.module-breakdown h4{
  letter-spacing: .2px;
}



.quiz-disclaimer {
  font-size: 0.8rem;
  color: #ccc; /* tono más suave */
  margin-top: 1rem;
  text-align: center; /* centrado para más equilibrio */
  font-style: italic; /* opcional: le da un toque de nota */
}
