/* ============================================================
   MANUAL — estilos de la portada y del motor.
   tokens/base/components no se tocan: son los mismos de siempre.
   ============================================================ */

/* ---------- Portada ---------- */
.cover {
  padding-block: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cover__logo {
  width: min(78vw, 340px);
  height: auto;
  margin-left: -8px;
  user-select: none;
  -webkit-user-drag: none;
}

.cover__lede {
  font-family: var(--font-display);
  font-size: var(--step-2);
  text-transform: uppercase;
  line-height: 1.05;
  max-width: 20ch;
}

.cover__lede em {
  font-style: normal;
  color: var(--primary);
}

.cover__sub {
  color: var(--text-muted);
  max-width: 38ch;
}

/* ---------- Buscador del manual ---------- */
.finder {
  position: sticky;
  top: 58px;
  z-index: 10;
  background: var(--background);
  padding-block: var(--sp-2);
}

/* ---------- Capítulos ---------- */
.toc {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-4);
  align-items: baseline;
  padding: var(--sp-4) var(--sp-2);
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background var(--fast) var(--ease);
}

.toc li:last-child a {
  border-bottom: 1px solid var(--border);
}

.toc a:hover {
  background: var(--surface);
}

.toc__n {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--primary);
}

.toc__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  text-transform: uppercase;
  line-height: 1.1;
}

.toc__claim {
  grid-column: 2;
  color: var(--text-muted);
  font-size: var(--step--1);
}

.toc li[hidden] {
  display: none;
}

.section-title {
  font-size: var(--step-2);
  margin-top: var(--sp-6);
}

/* ---------- Motor: pantallas ---------- */
.screen {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  flex: 1;
  animation: rise var(--base) var(--ease) both;
}

.screen__title {
  font-size: var(--step-3);
  max-width: 16ch;
}

.screen__hint {
  color: var(--text-muted);
  max-width: 36ch;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-5);
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
}

.scale--10 {
  grid-template-columns: repeat(5, 1fr);
}

.scale--10 button {
  aspect-ratio: auto;
  min-height: 52px;
}

textarea.input {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
  font-size: var(--step-0);
}

/* ---------- Motor: resultado ---------- */
.result__title {
  font-size: var(--step-3);
  color: var(--primary);
  max-width: 16ch;
  text-wrap: balance;
}

.result__big {
  font-family: var(--font-display);
  font-size: var(--step-2);
  text-transform: uppercase;
  line-height: 1.08;
  text-wrap: balance;
}

.result__p {
  max-width: 44ch;
  line-height: 1.6;
}

.result__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
  display: flex;
  flex-direction: column;
}

.result__steps li {
  counter-increment: paso;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

.result__steps li::before {
  content: counter(paso);
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--primary);
}

.result__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.result__list li {
  padding-left: var(--sp-4);
  position: relative;
  line-height: 1.5;
}

.result__list li::before {
  content: '×';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 800;
}

.result__kv {
  display: flex;
  flex-direction: column;
  border: var(--bd) solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.result__kv > div {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
}

.result__kv > div:first-child {
  border-top: 0;
}

.result__kv span {
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 700;
}

.result__warn {
  padding: var(--sp-3) var(--sp-4);
  border: var(--bd) solid var(--warning);
  border-radius: var(--radius);
  background: rgba(255, 176, 32, 0.08);
  font-weight: 600;
  font-size: var(--step--1);
  line-height: 1.55;
}

.honest {
  padding: var(--sp-4);
  border: var(--bd) dashed var(--border);
  border-radius: var(--radius);
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- Temporizador inline ---------- */
.timerbox {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-4);
  border: var(--bd) solid var(--primary);
  border-radius: var(--radius-lg);
  text-align: center;
}

.clock--inline {
  font-family: var(--font-display);
  font-size: clamp(3rem, 18vw, 4.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Navegación del manual al pie de cada app ---------- */
.manualnav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--border);
}

.manualnav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--step--1);
}

.manualnav a:hover {
  color: var(--primary-hover);
}

@media (min-width: 768px) {
  .screen__title {
    font-size: var(--step-4);
  }

  .actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }

  .actions .btn--block {
    width: auto;
    min-width: 220px;
  }
}

/* ---------- Medidor de porcentaje ---------- */
.meterbox {
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
  border: var(--bd) solid var(--primary);
  border-radius: var(--radius-lg);
}

.meterbox__n {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 20vw, 5.5rem);
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.meterbox__l {
  display: block;
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--sp-2);
}

.meterbox__bar {
  margin-top: var(--sp-4);
  height: 12px;
  background: var(--surface-2);
  border-radius: 7px;
  overflow: hidden;
}

.meterbox__bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 7px;
  transition: width 900ms var(--ease);
}

.meterbox--warn .meterbox__n { color: var(--warning); }
.meterbox--warn .meterbox__bar i { background: var(--warning); }
.meterbox--bad .meterbox__n { color: var(--danger, #ff4444); }
.meterbox--bad .meterbox__bar i { background: var(--danger, #ff4444); }
.meterbox--ok .meterbox__n { color: var(--success); }
.meterbox--ok .meterbox__bar i { background: var(--success); }

/* ---------- Lista tachable ---------- */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-top: 1px solid var(--border);
  cursor: pointer;
  line-height: 1.45;
  transition: opacity var(--fast) var(--ease);
}

.checklist li:first-child { border-top: 0; }

.checklist__box {
  flex: none;
  width: 22px;
  height: 22px;
  border: var(--bd) solid var(--border);
  border-radius: 6px;
  margin-top: 1px;
  position: relative;
}

.checklist li.is-off {
  opacity: 0.4;
  text-decoration: line-through;
}

.checklist li.is-off .checklist__box {
  background: var(--primary);
  border-color: var(--primary);
}

.checklist li.is-off .checklist__box::after {
  content: '';
  position: absolute;
  inset: 4px 5px;
  border: solid var(--on-primary);
  border-width: 0 0 3px 3px;
  transform: rotate(-45deg) translateY(-2px);
}

/* ---------- Texto para copiar ---------- */
.copybox {
  padding: var(--sp-4);
  border: var(--bd) solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.copybox p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copybox .btn { align-self: flex-start; }

/* ============================================================
   JUEGO #04 — LA RULETA DEL CARAJO
   ============================================================ */
.ruleta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  align-items: center;
  text-align: center;
  flex: 1;
  animation: rise var(--base) var(--ease) both;
}

.rueda {
  --c: var(--primary);
  width: min(58vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  border: var(--bd) solid var(--text);
  transition: background 120ms linear;
  margin-top: var(--sp-4);
}

.rueda__cat {
  font-family: var(--font-display);
  font-size: var(--step-0);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--background);
  padding-inline: var(--sp-2);
  text-wrap: balance;
}

.salida {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  justify-content: center;
}

.salida__txt {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.12;
  text-wrap: balance;
  animation: pop var(--base) var(--ease) both;
}

.salida__re {
  color: var(--text-muted);
  font-size: var(--step--1);
}

.eyebrow--raro {
  color: var(--warning);
}

.btn--girar {
  font-size: var(--step-1);
  padding-block: var(--sp-4);
  letter-spacing: 0.05em;
}

/* ============================================================
   JUEGO #05 — DECIDÍ EN 10 SEGUNDOS
   ============================================================ */
.dilema {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  flex: 1;
  justify-content: center;
  animation: rise var(--fast) var(--ease) both;
}

.dilema--inicio,
.dilema--fin {
  justify-content: flex-start;
  padding-top: var(--sp-5);
}

.dilema__paso {
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.reloj {
  position: relative;
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.reloj__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--primary);
  border-radius: 6px;
  transition: width 100ms linear;
}

.reloj__fill--poco {
  background: var(--danger, #ff4444);
}

.reloj__n {
  position: absolute;
  right: 0;
  top: 18px;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.dilema__q {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
  text-wrap: balance;
  margin-top: var(--sp-4);
}

.opciones {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.opcion {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-align: left;
  padding: var(--sp-4);
  background: var(--surface);
  border: var(--bd) solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.3;
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.opcion:active {
  transform: scale(0.98);
  border-color: var(--primary);
}

.opcion b {
  font-family: var(--font-display);
  color: var(--primary);
  font-size: var(--step-1);
  flex: none;
}

.dilema--reaccion {
  text-align: center;
}

.reaccion {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  animation: pop var(--base) var(--ease) both;
}

.reaccion__eleg {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--primary);
}

.reaccion__eleg--nada {
  color: var(--danger, #ff4444);
}

.reaccion__txt {
  color: var(--text-muted);
  font-size: var(--step-0);
  max-width: 30ch;
  margin-inline: auto;
}
