:root {
  --fondo: #f6f5f2;
  --panel: #ffffff;
  --panel-2: #efede8;
  --tinta: #1b1c1f;
  --tenue: #63666d;
  --linea: #dcd9d2;
  --acento: #d9481f;
  --acento-suave: #fbe5dc;
  --si: #1f8a4c;
  --si-suave: #dcf1e3;
  --casi: #b7791f;
  --casi-suave: #fbefd6;
  --no: #b4363c;
  --no-suave: #f8dfe0;
  --sin: #b9b6ae;
  --sombra: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .05);
  --radio: 14px;
  --letra: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #121316;
    --panel: #1b1d21;
    --panel-2: #24272c;
    --tinta: #eceae5;
    --tenue: #a0a3aa;
    --linea: #33363c;
    --acento: #f2683f;
    --acento-suave: #3a2219;
    --si: #46c27a;
    --si-suave: #183325;
    --casi: #e5a643;
    --casi-suave: #3a2e17;
    --no: #ee6b70;
    --no-suave: #3c1f22;
    --sin: #5b5e65;
    --sombra: 0 1px 2px rgb(0 0 0 / .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 16px/1.5 var(--letra);
  min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.contenedor { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------- barra superior */
.barra {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--fondo) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.barra .contenedor { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.marca-app { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.marca-app img { width: 26px; height: 26px; }
.barra .titulo-video { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tenue); font-size: 14px; }
.barra .espacio { flex: 1; }
.boton-texto {
  background: none; border: 0; padding: 8px 10px; border-radius: 8px;
  color: var(--tenue); font-size: 14px; text-decoration: none; white-space: nowrap;
}
.boton-texto:hover { background: var(--panel-2); color: var(--tinta); }

/* ------------------------------------------------------------- botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--linea); background: var(--panel); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; text-decoration: none; min-height: 44px;
}
.boton:hover { border-color: var(--tenue); }
.boton.principal { background: var(--acento); border-color: var(--acento); color: #fff; }
.boton.principal:hover { filter: brightness(1.07); }
.boton:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------- entrada */
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.tarjeta-entrada {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--linea);
  border-radius: 18px; padding: 28px 24px; box-shadow: var(--sombra); display: grid; gap: 16px;
}
.tarjeta-entrada img { width: 44px; height: 44px; }
.tarjeta-entrada label { font-size: 14px; color: var(--tenue); display: grid; gap: 6px; }
.tarjeta-entrada input {
  border: 1px solid var(--linea); border-radius: 10px; padding: 12px 14px; background: var(--fondo); font-size: 16px;
}
.error { color: var(--no); font-size: 14px; min-height: 1.5em; }

/* ------------------------------------------------------------- inicio */
.inicio { padding: 28px 0 64px; display: grid; gap: 28px; }
.encabezado h1 { font-size: clamp(26px, 5vw, 34px); letter-spacing: -.01em; }
.encabezado p { color: var(--tenue); margin-top: 6px; max-width: 62ch; }

.meta {
  background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 20px; box-shadow: var(--sombra); display: grid; gap: 14px;
}
.meta-cifras { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.meta-cifras strong { font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.meta-cifras span { color: var(--tenue); }
.meta-estado { font-weight: 600; }
.meta-estado.logrado { color: var(--si); }
.barra-apilada { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--panel-2); position: relative; }
.barra-apilada > i { display: block; height: 100%; }
.barra-apilada .si { background: var(--si); }
.barra-apilada .casi { background: var(--casi); }
.barra-apilada .no { background: var(--no); }
.barra-apilada .linea-meta { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--tinta); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--tenue); }
.leyenda b { color: var(--tinta); font-variant-numeric: tabular-nums; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.punto.si { background: var(--si); } .punto.casi { background: var(--casi); }
.punto.no { background: var(--no); } .punto.sin { background: var(--sin); }

.rondas { display: flex; gap: 10px; flex-wrap: wrap; }
.ronda-tab {
  display: grid; gap: 2px; min-width: 160px; padding: 10px 16px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 12px;
}
.ronda-tab:hover { border-color: var(--tenue); }
.ronda-tab b { font-size: 15px; }
.ronda-tab span { font-size: 13px; color: var(--tenue); font-variant-numeric: tabular-nums; }
.ronda-tab[aria-current="page"] { border-color: var(--acento); box-shadow: inset 0 -3px 0 var(--acento); }
.meta .seccion-titulo { margin-bottom: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.fuente { font-size: 13px; font-weight: 600; color: var(--tenue); background: var(--panel-2); border-radius: 999px; padding: 2px 10px; }
.meta-nota { color: var(--tenue); font-size: 15px; max-width: 72ch; }

.pasos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.paso { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; display: grid; gap: 6px; }
.paso .num { width: 28px; height: 28px; border-radius: 50%; background: var(--acento-suave); color: var(--acento); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.paso p { color: var(--tenue); font-size: 15px; }
.paso p b { color: var(--tinta); }

.seccion-titulo { font-size: 18px; margin-bottom: 12px; }
.rejilla-videos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tarjeta-video {
  background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio);
  overflow: hidden; display: grid; text-decoration: none; box-shadow: var(--sombra);
  transition: transform .15s, border-color .15s;
}
.tarjeta-video:hover { transform: translateY(-2px); border-color: var(--tenue); }
.miniatura { position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duracion { position: absolute; right: 8px; bottom: 8px; background: rgb(0 0 0 / .78); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.tarjeta-video .cuerpo { padding: 14px 16px 16px; display: grid; gap: 10px; }
.tarjeta-video h3 { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tarjeta-video .canal { color: var(--tenue); font-size: 13px; }
.progreso-video { display: grid; gap: 6px; font-size: 13px; color: var(--tenue); }
.progreso-video .fila { display: flex; justify-content: space-between; gap: 8px; }
.tarjeta-video .accion { color: var(--acento); font-weight: 600; font-size: 14px; }
.vacio { background: var(--panel); border: 1px dashed var(--linea); border-radius: var(--radio); padding: 32px; text-align: center; color: var(--tenue); }

/* ------------------------------------------------------------- revisor */
.revisor { display: grid; gap: 20px; padding: 16px 0 72px; }
@media (min-width: 960px) {
  .revisor { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); align-items: start; padding-top: 24px; }
  /* La lista de momentos acompaña al bajar y, si es larga, se desplaza por dentro. */
  .revisor > aside { position: sticky; top: 72px; max-height: calc(100dvh - 88px); overflow-y: auto; }
}
.columna-principal { display: grid; gap: 16px; }

.reproductor { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radio); overflow: hidden; }
@media (max-width: 959px) {
  .reproductor-fijo { position: sticky; top: 56px; z-index: 10; margin: 0 -16px; }
  .reproductor-fijo .reproductor { border-radius: 0; }
}
.reproductor iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.portada { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; color: #fff; }
.portada img { width: 100%; height: 100%; object-fit: cover; opacity: .55; display: block; }
.portada .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; background: var(--acento); color: #fff;
  border-radius: 999px; padding: 12px 20px 12px 16px; font-weight: 700; box-shadow: 0 6px 24px rgb(0 0 0 / .35);
  white-space: nowrap;
}
.portada .play svg { width: 22px; height: 22px; }
.portada:hover .play { filter: brightness(1.08); }
.fin-momento {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  background: rgb(0 0 0 / .84); color: #fff; border-radius: 999px; padding: 6px 6px 6px 14px;
  font-size: 14px; font-weight: 600; box-shadow: 0 4px 18px rgb(0 0 0 / .4);
}
.fin-momento button { border: 0; border-radius: 999px; background: var(--acento); color: #fff; padding: 6px 12px; font-weight: 700; font-size: 14px; }

.panel { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 18px; display: grid; gap: 14px; box-shadow: var(--sombra); }
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.etiqueta { background: var(--panel-2); color: var(--tenue); border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.etiqueta.tiempo { font-family: var(--mono); font-weight: 500; }
.etiqueta.chat-fuerte { background: var(--acento-suave); color: var(--acento); }
.etiqueta.larga { background: var(--tinta); color: var(--panel); }
.etiqueta.alerta { background: var(--casi-suave); color: var(--casi); }
.momento-titulo { font-size: clamp(19px, 3.2vw, 23px); }
.version {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--tenue);
  background: var(--panel-2); border-radius: 12px; padding: 10px 14px;
}
.version span { flex: 1 1 220px; }
.version .boton { min-height: 38px; padding: 6px 14px; font-size: 14px; white-space: nowrap; }
.antes { border: 1px solid var(--linea); border-left: 4px solid var(--tenue); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; font-size: 14px; }
.antes-titulo { font-weight: 700; }
.antes-fila { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.antes-fila .pildora { white-space: nowrap; }
.antes-fila div { display: grid; gap: 2px; min-width: 0; }
.tiempo-antes, .antes-ahora { font-family: var(--mono); font-size: 12px; color: var(--tenue); }
.antes-motivos { color: var(--tenue); }
.antes-nota { font-style: italic; overflow-wrap: anywhere; }
.momento-resumen { color: var(--tenue); }
details.por-que { border-top: 1px solid var(--linea); padding-top: 10px; }
details.por-que summary { cursor: pointer; color: var(--tenue); font-size: 14px; font-weight: 600; }
details.por-que p { margin-top: 8px; font-size: 15px; }

.pregunta { font-weight: 700; font-size: 17px; }
.pregunta small { display: block; font-weight: 400; font-size: 14px; color: var(--tenue); }
.veredictos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.veredicto {
  display: grid; justify-items: center; gap: 2px; text-align: center;
  border: 2px solid var(--linea); background: var(--panel); border-radius: 12px; padding: 12px 6px; min-height: 76px;
  transition: background-color .12s, border-color .12s, transform .08s;
}
.veredicto:active { transform: scale(.97); }
.veredicto .icono { font-size: 22px; line-height: 1; }
.veredicto .nombre { font-weight: 700; }
.veredicto .ayuda { font-size: 12px; color: var(--tenue); line-height: 1.3; }
.veredicto .tecla { display: none; font-family: var(--mono); font-size: 11px; color: var(--tenue); border: 1px solid var(--linea); border-radius: 4px; padding: 0 5px; margin-top: 4px; }
@media (hover: hover) and (min-width: 960px) { .veredicto .tecla { display: inline-block; } }
.veredicto.si:hover, .veredicto.si[aria-pressed="true"] { border-color: var(--si); background: var(--si-suave); }
.veredicto.casi:hover, .veredicto.casi[aria-pressed="true"] { border-color: var(--casi); background: var(--casi-suave); }
.veredicto.no:hover, .veredicto.no[aria-pressed="true"] { border-color: var(--no); background: var(--no-suave); }
.veredicto[aria-pressed="true"] .nombre { color: var(--tinta); }
.veredicto.si[aria-pressed="true"] .icono { color: var(--si); }
.veredicto.casi[aria-pressed="true"] .icono { color: var(--casi); }
.veredicto.no[aria-pressed="true"] .icono { color: var(--no); }

.motivos { display: grid; gap: 8px; }
.motivos p { font-size: 14px; color: var(--tenue); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--linea); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--panel); border-color: var(--tinta); }

.nota label { font-size: 14px; color: var(--tenue); font-weight: 600; display: grid; gap: 6px; }
.nota textarea { border: 1px solid var(--linea); border-radius: 10px; padding: 10px 12px; background: var(--fondo); resize: vertical; min-height: 44px; font-size: 15px; }

.pedir {
  display: flex; align-items: center; gap: 12px; border: 1px dashed var(--linea); border-radius: 12px; padding: 12px 14px;
}
.pedir .texto { flex: 1; font-size: 14px; color: var(--tenue); }
.pedir .texto b { color: var(--tinta); display: block; font-size: 15px; }
.interruptor { position: relative; width: 50px; height: 30px; border-radius: 999px; border: 0; background: var(--sin); flex: none; transition: background-color .15s; }
.interruptor::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.interruptor[aria-checked="true"] { background: var(--acento); }
.interruptor[aria-checked="true"]::after { transform: translateX(20px); }
.pedir.activo { border-style: solid; border-color: var(--acento); background: var(--acento-suave); }

.navegacion { display: flex; gap: 8px; flex-wrap: wrap; }
.navegacion .boton { flex: 1; white-space: nowrap; padding: 10px 12px; }
.navegacion .siguiente { flex: 2; }
.atajos { font-size: 12px; color: var(--tenue); display: none; }
@media (hover: hover) and (min-width: 960px) { .atajos { display: block; } }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--linea); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }

/* línea de tiempo */
.linea-tiempo { display: grid; gap: 6px; }
.linea-tiempo .cabeza { display: flex; justify-content: space-between; align-items: baseline; }
.linea-tiempo h2 { font-size: 15px; }
.linea-tiempo .cabeza span { font-size: 13px; color: var(--tenue); }
.pista { position: relative; height: 46px; background: var(--panel-2); border-radius: 8px; overflow: hidden; }
.pista .calor { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; width: 100%; color: var(--tenue); opacity: .35; }
.pista .pico { position: absolute; top: 0; width: 2px; height: 10px; background: var(--acento); border-radius: 0 0 2px 2px; transform: translateX(-1px); }
.pista .bloque {
  position: absolute; top: 14px; bottom: 12px; min-width: 6px; border: 0; padding: 0;
  background: var(--sin); border-radius: 4px;
}
.pista .bloque.largo { top: auto; bottom: 3px; height: 5px; border-radius: 3px; }
.pista .bloque.si { background: var(--si); } .pista .bloque.casi { background: var(--casi); } .pista .bloque.no { background: var(--no); }
.pista .bloque.actual { outline: 2px solid var(--tinta); outline-offset: 1px; z-index: 2; }
.reglas { display: flex; justify-content: space-between; font-size: 12px; color: var(--tenue); font-family: var(--mono); }
.leyenda-pista { font-size: 12px; color: var(--tenue); display: flex; gap: 14px; flex-wrap: wrap; }
.leyenda-pista i { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 5px; border-radius: 2px; }
.leyenda-pista .l-pico { width: 2px; background: var(--acento); }
.leyenda-pista .l-largo { width: 16px; height: 5px; background: var(--sin); vertical-align: 2px; }
.cambio-ronda { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.cambio-ronda a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--linea); text-decoration: none; color: var(--tenue); font-weight: 600; }
.cambio-ronda a[aria-current="page"] { background: var(--tinta); color: var(--panel); border-color: var(--tinta); }

/* lista de momentos */
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fila-marca {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; gap: 4px 10px; align-items: center; text-align: left;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 12px; padding: 10px 12px;
}
.fila-marca:hover { border-color: var(--tenue); }
.fila-marca.larga { margin-left: 18px; width: calc(100% - 18px); border-style: dashed; }
.fila-marca[aria-current="true"] { border-color: var(--acento); box-shadow: inset 3px 0 0 var(--acento); }
.fila-marca .n { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--tenue); }
.fila-marca .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fila-marca .h { grid-column: 2; font-size: 12px; color: var(--tenue); font-family: var(--mono); }
.fila-marca .estado { grid-row: 1 / span 2; grid-column: 3; display: flex; align-items: center; gap: 6px; }
.pildora { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--tenue); }
.pildora.si { background: var(--si-suave); color: var(--si); }
.pildora.casi { background: var(--casi-suave); color: var(--casi); }
.pildora.no { background: var(--no-suave); color: var(--no); }
.tijera { font-size: 14px; color: var(--acento); }

/* ------------------------------------------------------------- avisos */
.aviso {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--tinta); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 6px 24px rgb(0 0 0 / .25); z-index: 50; max-width: calc(100% - 32px);
}
.aviso.mal { background: var(--no); color: #fff; }
.cargando { padding: 48px 16px; text-align: center; color: var(--tenue); }
.noscript { padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
