/* Estilo "Vibrant & Block": colores fuertes, bordes marcados, sombras duras. Mobile-first. */
:root {
  --ink: #1b1030;
  --bg: #fff7f2;
  --card: #ffffff;
  --rose: #e11d48;
  --rose-soft: #ffe1e8;
  --blue: #2563eb;
  --blue-soft: #dbe7ff;
  --yellow: #facc15;
  --violet: #7c3aed;
  --violet-soft: #ece4ff;
  --green: #15803d;
  --green-soft: #d8f5e1;
  --muted: #5b5370;
  --line: 2px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 16px;
  --font-h: "Nunito", system-ui, sans-serif;
  --font-b: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 16px/1.55 var(--font-b);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--font-h); font-weight: 900; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 5vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 80px; }
.icon { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: var(--line); }
.top .in { max-width: 880px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font: 900 1.2rem var(--font-h); color: var(--ink); text-decoration: none; min-height: 44px; }
.brand .logo { width: 34px; height: 34px; background: var(--rose); color: #fff; border: var(--line); border-radius: 10px; display: grid; place-items: center; box-shadow: 2px 2px 0 var(--ink); }
.pills { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: var(--line); border-radius: 999px; background: var(--yellow); font: 800 .95rem var(--font-h); }
.pill.fire { background: var(--rose-soft); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; cursor: pointer;
  font: 800 1rem var(--font-h); color: #fff; background: var(--rose);
  border: var(--line); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.blue { background: var(--blue); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Tarjetas */
.card { background: var(--card); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin: 0 0 20px; }
.card.rose { background: var(--rose-soft); }
.card.blue { background: var(--blue-soft); }
.card.violet { background: var(--violet-soft); }
.card.green { background: var(--green-soft); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: var(--line); border-radius: 999px; font: 800 .8rem var(--font-h); background: #fff; text-transform: uppercase; letter-spacing: .04em; }

/* Home */
.hero { padding: 28px 0 12px; }
.hero h1 span { background: var(--yellow); padding: 0 .2em; border-radius: 8px; box-decoration-break: clone; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 8px; }
.stat { background: #fff; border: var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: 3px 3px 0 var(--ink); }
.stat b { display: block; font: 900 1.6rem var(--font-h); }
.stat small { color: var(--muted); font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: var(--line); border-radius: 999px; font: 800 .85rem var(--font-h); background: var(--yellow); }
.badge.off { background: #fff; color: var(--muted); border-style: dashed; border-color: var(--muted); }
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font: 800 .95rem var(--font-h); margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; font: 500 1rem var(--font-b); color: var(--ink);
  background: #fff; border: var(--line); border-radius: 12px;
}
textarea { min-height: 84px; resize: vertical; }

/* Mapa de niveles */
.map { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; position: relative; }
.node { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.node .num { width: 56px; height: 56px; border: var(--line); border-radius: 50%; display: grid; place-items: center; font: 900 1.5rem var(--font-h); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.node.locked { opacity: .65; }
.node.locked .num { background: #e9e4f2; }
.node.done .num { background: var(--green); color: #fff; }
.node .box { background: #fff; border: var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.node.locked .box { box-shadow: none; border-style: dashed; }
.bar { height: 14px; background: #fff; border: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.bar i { display: block; height: 100%; background: var(--blue); transition: width .4s ease; }

/* Nivel: cabecera y pasos */
.lvl-head { padding: 18px 0 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-weight: 800; text-decoration: none; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; padding: 0; list-style: none; }
.steps a, .steps span.s {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px;
  border: var(--line); border-radius: 12px; font: 900 .95rem var(--font-h); text-decoration: none; color: var(--ink); background: #fff;
}
.steps .done a { background: var(--green); color: #fff; }
.steps .cur a { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.steps .lock span.s { background: #e9e4f2; color: var(--muted); border-style: dashed; }

/* Video */
.video { position: relative; aspect-ratio: 16 / 9; border: var(--line); border-radius: var(--r); overflow: hidden; background: #000; box-shadow: var(--shadow); margin-bottom: 20px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.learn { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 8px; }
.learn li { display: flex; gap: 10px; align-items: flex-start; }
.learn .icon { color: var(--blue); margin-top: 3px; }

/* Preguntas */
.opts { display: grid; gap: 10px; margin: 12px 0; }
.opt {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  min-height: 52px; padding: 12px 14px; cursor: pointer;
  font: 600 1rem var(--font-b); color: var(--ink); background: #fff;
  border: var(--line); border-radius: 14px; transition: transform .15s ease, background .15s ease;
}
.opt:hover:not([disabled]) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.opt .l { flex: none; width: 30px; height: 30px; border: var(--line); border-radius: 50%; display: grid; place-items: center; font: 900 .85rem var(--font-h); background: var(--violet-soft); }
.opt.ok { background: var(--green-soft); border-color: var(--green); }
.opt.bad { background: var(--rose-soft); border-color: var(--rose); }
.opt[disabled] { cursor: default; }
.fb { margin-top: 10px; padding: 12px 14px; border: var(--line); border-radius: 12px; background: #fff; font-weight: 600; }
.fb.ok { background: var(--green-soft); }
.fb.bad { background: var(--rose-soft); }
.fb b { font-family: var(--font-h); }

/* Tabla de datos */
.tablewrap { overflow-x: auto; border: var(--line); border-radius: 14px; background: #fff; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { padding: 8px 6px; text-align: right; border-bottom: 1px solid #d9d2e6; }
@media (min-width: 560px) { table { font-size: .95rem; } th, td { padding: 10px 12px; } }
abbr[title] { text-decoration: none; cursor: help; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--yellow); font: 800 .85rem var(--font-h); border-bottom: var(--line); }
tbody tr:last-child td { border-bottom: 0; }

/* Misión */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border: var(--line); border-radius: 999px; background: #fff; font: 800 1rem var(--font-h); }
.chip input:checked + span { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.brandcard { background: var(--ink); color: #fff; border-radius: 20px; padding: 22px; border: var(--line); box-shadow: 6px 6px 0 var(--rose); }
.brandcard .tag { color: var(--ink); }
.brandcard h3 { font-size: 1.5rem; margin: 10px 0 4px; }
.brandcard dl { margin: 14px 0 0; display: grid; gap: 10px; }
.brandcard dt { font: 800 .75rem var(--font-h); text-transform: uppercase; letter-spacing: .06em; color: var(--yellow); }
.brandcard dd { margin: 0; }
.brandcard ol { margin: 0; padding-left: 20px; }

/* Aviso de XP */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 30;
  background: var(--yellow); border: var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 18px; font: 900 1rem var(--font-h); transition: all .3s ease; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Certificado */
.cert { border: 4px double var(--ink); background: #fff; padding: 28px 20px; text-align: center; border-radius: 20px; }
.cert h2 { font-size: 1.9rem; }
.cert .who { font: 900 2rem var(--font-h); color: var(--rose); margin: 8px 0; word-break: break-word; }

@media (min-width: 640px) {
  .wrap { padding-bottom: 100px; }
  .card { padding: 26px; }
  .opts.two { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .top, .noprint, .steps, .lvl-head { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
