/* ==========================================================
   Brújula 29-N — estilos
   Paleta neutra (tinta/grafito) para no evocar a ningún partido.
   ========================================================== */

:root {
  --fondo: #f6f5f2;
  --superficie: #ffffff;
  --superficie-2: #efede8;
  --borde: #dcd9d2;
  --texto: #1d1f24;
  --texto-suave: #5a5e68;
  --acento: #2b3445;
  --acento-texto: #ffffff;
  --acento-suave: #e3e6ec;
  --foco: #6a7ba2;
  --ok: #2f7a4f;
  --ko: #a33b3b;
  --aviso-fondo: #fbf6e9;
  --aviso-borde: #e7d8ad;
  --sombra: 0 1px 2px rgba(20, 22, 28, .05), 0 6px 20px rgba(20, 22, 28, .06);
  --radio: 14px;
  --radio-s: 9px;
  --fuente: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-titulo: "Georgia", "Iowan Old Style", "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #14161b;
    --superficie: #1c1f26;
    --superficie-2: #252932;
    --borde: #343945;
    --texto: #eceef2;
    --texto-suave: #a5abb8;
    --acento: #d9dfeb;
    --acento-texto: #14161b;
    --acento-suave: #2c3240;
    --foco: #8fa2cf;
    --ok: #6cc293;
    --ko: #e48686;
    --aviso-fondo: #2a2619;
    --aviso-borde: #5b4f2b;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.55;
  color: var(--texto);
  background: var(--fondo);
}
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 6px; }
kbd {
  font-family: ui-monospace, Consolas, monospace; font-size: .8em;
  padding: .05em .4em; border: 1px solid var(--borde); border-bottom-width: 2px;
  border-radius: 5px; background: var(--superficie);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.contenedor { width: 100%; max-width: 920px; margin: 0 auto; padding-inline: 20px; }

/* ---------- Cabecera ---------- */
.cabecera { border-bottom: 1px solid var(--borde); background: var(--superficie); position: sticky; top: 0; z-index: 10; }
.cabecera__fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.marca { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.1rem; }
.marca__icono { font-size: 1.3rem; }
.cabecera__nota { color: var(--texto-suave); font-size: .85rem; }

/* ---------- Botones ---------- */
.boton {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: .65em 1.3em; border: 1.5px solid transparent;
  transition: transform .08s ease, background .15s ease, opacity .15s ease;
}
.boton:active { transform: translateY(1px); }
.boton:disabled { opacity: .4; cursor: not-allowed; }
.boton--primario { background: var(--acento); color: var(--acento-texto); }
.boton--primario:not(:disabled):hover { opacity: .9; }
.boton--secundario { background: var(--superficie); color: var(--texto); border-color: var(--borde); }
.boton--secundario:hover { border-color: var(--texto-suave); }
.boton--fantasma { background: transparent; color: var(--texto-suave); }
.boton--fantasma:hover { color: var(--texto); background: var(--superficie-2); }
.boton--grande { font-size: 1.05rem; padding: .8em 1.6em; }

/* ---------- Pantallas ---------- */
.pantalla { padding-block: 32px 48px; animation: aparecer .25s ease; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pantalla, .progreso__relleno, .barra__relleno { animation: none !important; transition: none !important; } }

.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  box-shadow: var(--sombra); padding: 24px; margin-bottom: 20px;
}

/* ---------- Inicio ---------- */
.hero { max-width: 720px; }
.hero__antetitulo { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--texto-suave); margin: 0 0 8px; }
.hero__titulo { font-family: var(--fuente-titulo); font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.01em; }
.hero__texto { font-size: 1.08rem; color: var(--texto-suave); margin: 0 0 20px; }
.hero__claves { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--texto-suave); font-size: .92rem; }
.hero__claves span { margin-right: 4px; }

.aviso { background: var(--aviso-fondo); border: 1px solid var(--aviso-borde); border-radius: var(--radio-s); padding: 14px 16px; font-size: .93rem; margin-bottom: 24px; }
.aviso strong { display: block; margin-bottom: 2px; }

.inicio-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.campo__etiqueta { font-weight: 600; }
.campo__ayuda { font-weight: 400; color: var(--texto-suave); font-size: .88rem; }
.campo__select {
  font: inherit; color: var(--texto); background: var(--superficie);
  border: 1.5px solid var(--borde); border-radius: var(--radio-s);
  padding: .6em .8em; min-width: min(100%, 320px); max-width: 100%;
}

/* ---------- Fuentes ---------- */
.fuentes { margin-top: 36px; border-top: 1px solid var(--borde); padding-top: 16px; }
.fuentes summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.fuentes__lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.fuente { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 12px 14px; font-size: .9rem; border-left: 5px solid var(--color-partido, var(--borde)); }
.fuente__nombre { font-weight: 700; display: block; }
.fuente__meta { color: var(--texto-suave); font-size: .82rem; display: block; margin: 2px 0 6px; }
.fuente__enlaces { display: flex; flex-direction: column; gap: 3px; }
.fuente__enlaces > a { font-weight: 600; }
.fuente__otras { margin-top: 4px; font-size: .84rem; }
.fuente__otras summary { cursor: pointer; color: var(--texto-suave); }
.fuente__otras ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.fuente__nombre, .fuente__enlaces a { overflow-wrap: anywhere; }
.etiqueta-anio { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1em .5em; border-radius: 999px; background: var(--acento-suave); margin-left: 4px; vertical-align: 1px; }
.etiqueta-anio--nuevo { background: var(--ok); color: #fff; }

/* ---------- Test ---------- */
.progreso__barra { height: 6px; background: var(--superficie-2); border-radius: 999px; overflow: hidden; }
.progreso__relleno { height: 100%; width: 0; background: var(--acento); border-radius: inherit; transition: width .3s ease; }
.test__meta { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 12px; gap: 8px; }
.chip { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .03em; padding: .3em .8em; border-radius: 999px; background: var(--acento-suave); }
.test__contador { color: var(--texto-suave); font-variant-numeric: tabular-nums; font-size: .9rem; }

.pregunta__texto { font-family: var(--fuente-titulo); font-size: clamp(1.3rem, 3.4vw, 1.7rem); line-height: 1.25; margin: 0 0 6px; }
.pregunta__contexto { color: var(--texto-suave); margin: 0 0 18px; font-size: .95rem; }
.pregunta__contexto:empty { display: none; }

.opciones { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion label {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 13px 16px; border: 1.5px solid var(--borde); border-radius: var(--radio-s);
  background: var(--superficie); transition: border-color .12s ease, background .12s ease;
}
.opcion label:hover { border-color: var(--texto-suave); }
.opcion__tecla {
  flex: none; width: 1.7em; height: 1.7em; display: grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--borde); font-size: .82rem; font-weight: 700; color: var(--texto-suave);
}
.opcion input:checked + label { border-color: var(--acento); background: var(--acento-suave); }
.opcion input:checked + label .opcion__tecla { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.opcion input:focus-visible + label { outline: 3px solid var(--foco); outline-offset: 2px; }

.pregunta__pie { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--borde); }
.importancia { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.importancia__etiqueta { font-size: .9rem; color: var(--texto-suave); margin-right: 6px; }
.importancia__btn {
  font: inherit; font-size: .88rem; cursor: pointer; padding: .3em .9em; border-radius: 999px;
  border: 1.5px solid var(--borde); background: var(--superficie); color: var(--texto);
}
.importancia__btn[aria-checked="true"] { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }

.test__nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.test__atajo { text-align: center; color: var(--texto-suave); font-size: .8rem; margin-top: 16px; }
@media (max-width: 560px) {
  .test__nav { display: grid; grid-template-columns: 1fr 1fr; }
  #btn-saltar { grid-column: 1 / -1; grid-row: 1; }
  .test__atajo { display: none; }
}

/* ---------- Resultados ---------- */
.resultados__titulo { font-family: var(--fuente-titulo); font-size: clamp(1.6rem, 4.4vw, 2.3rem); line-height: 1.15; margin: 0 0 20px; }
.seccion__titulo { font-size: 1.15rem; margin: 0 0 4px; }
.seccion__ayuda { color: var(--texto-suave); font-size: .9rem; margin: 0 0 14px; }

.perfil { display: grid; grid-template-columns: 1fr minmax(220px, 280px); gap: 24px; align-items: center; background: linear-gradient(135deg, var(--superficie) 0%, var(--acento-suave) 140%); }
@media (max-width: 700px) { .perfil { grid-template-columns: 1fr; } }
.perfil__etiqueta { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 700; color: var(--texto-suave); }
.perfil__frase { font-family: var(--fuente-titulo); font-size: clamp(1.15rem, 3vw, 1.45rem); line-height: 1.35; margin: 0 0 10px; }
.perfil__nota { font-size: .8rem; color: var(--texto-suave); margin: 0; }
.eje { margin-bottom: 14px; }
.eje:last-child { margin-bottom: 0; }
.eje__nombre { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); margin-bottom: 4px; }
.eje__pista { position: relative; height: 8px; border-radius: 999px; background: var(--superficie-2); border: 1px solid var(--borde); }
.eje__pista::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--borde); }
.eje__punto { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--acento); border: 2px solid var(--superficie); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.25); z-index: 1; }
.eje__extremos { display: flex; justify-content: space-between; font-size: .76rem; color: var(--texto-suave); margin-top: 4px; gap: 8px; }

.filtro-res { font-size: .88rem; color: var(--texto-suave); margin-bottom: 14px; }
.filtro-res input { margin-right: 6px; vertical-align: -2px; }

.barras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.barra { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 3.6em; gap: 12px; align-items: center; }
.barra__nombre { font-weight: 700; line-height: 1.2; }
.barra__nombre small { display: block; font-weight: 400; font-size: .76rem; color: var(--texto-suave); }
.barra__tubo { height: 22px; background: var(--superficie-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--borde); }
.barra__relleno { height: 100%; width: 0; border-radius: inherit; background: var(--color-partido); transition: width .9s cubic-bezier(.2,.7,.2,1); }
.barra__pct { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; font-size: 1.05rem; }
.barra--fuera { opacity: .55; }
.tarjeta { scroll-margin-top: 72px; }
@media (max-width: 560px) {
  .barra { grid-template-columns: 1fr 3.4em; gap: 4px 10px; }
  .barra__nombre { grid-column: 1 / -1; }
}

.conclusion h2 { font-family: var(--fuente-titulo); font-size: 1.45rem; margin: 0 0 10px; }
.conclusion__cabecera { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.conclusion__logo { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--color-partido); font-size: .95rem; text-shadow: 0 1px 2px rgba(0,0,0,.35); flex: none; }
.conclusion p { margin: 0 0 12px; }
.conclusion h3 { font-size: 1rem; margin: 20px 0 8px; }
.lista-just { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.lista-just li { border-left: 3px solid var(--ok); padding: 4px 0 4px 12px; font-size: .94rem; }
.lista-just--ko li { border-left-color: var(--ko); }
.lista-just__preg { font-weight: 600; display: block; }
.lista-just__pos { color: var(--texto-suave); display: block; }
.lista-just__fuente { font-size: .78rem; color: var(--texto-suave); font-style: italic; }
.conclusion__nota { font-size: .85rem; color: var(--texto-suave); border-top: 1px dashed var(--borde); padding-top: 12px; margin-top: 16px !important; }

.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mapa { border-collapse: separate; border-spacing: 3px; font-size: .82rem; min-width: 640px; width: 100%; }
.mapa th { font-weight: 600; text-align: left; padding: 4px 6px; white-space: nowrap; }
.mapa thead th { text-align: center; font-size: .75rem; }
.mapa td { text-align: center; padding: 6px 4px; border-radius: 5px; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 46px; }
.mapa td.vacio { color: var(--texto-suave); font-weight: 400; background: var(--superficie-2); }

.desplegable summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.desplegable summary::-webkit-details-marker { display: none; }
.desplegable summary::after { content: "Mostrar ▾"; font-size: .85rem; font-weight: 600; color: var(--texto-suave); }
.desplegable[open] summary::after { content: "Ocultar ▴"; }
.desplegable[open] summary { margin-bottom: 8px; }
.detalle { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.detalle__item { border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 12px 14px; font-size: .9rem; }
.detalle__cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.detalle__preg { font-weight: 600; }
.detalle__pct { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detalle__fila { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; margin-top: 6px; }
.detalle__fila dt { color: var(--texto-suave); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.detalle__fila dd { margin: 0; }
@media (max-width: 560px) { .detalle__fila { grid-template-columns: 1fr; gap: 0; } }

.acciones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 28px 0 8px; }

/* ---------- Pie ---------- */
.pie { border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: .82rem; padding-block: 24px 40px; }
.pie p { margin: 0 0 8px; max-width: 760px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--acento); color: var(--acento-texto); padding: .6em 1.2em; border-radius: 999px; font-size: .9rem; box-shadow: var(--sombra); z-index: 50; }

/* ---------- Contenido estático (SEO) y páginas secundarias ---------- */
img.marca__icono { width: 28px; height: 28px; border-radius: 7px; display: block; }
.seo-bloque { margin-top: 44px; }
.seo-bloque__titulo { font-family: var(--fuente-titulo); font-size: 1.5rem; margin: 0 0 14px; line-height: 1.2; }
.seo-bloque h3 { font-size: 1rem; margin: 0 0 4px; }
.seo-bloque p { margin: 0 0 10px; }
.seo-columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; }
.seo-columnas > div { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 16px; }
.temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.temas details { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 10px 14px; }
.temas summary { cursor: pointer; font-weight: 700; }
.temas summary span { font-weight: 400; color: var(--texto-suave); font-size: .85rem; }
.temas ol { margin: 8px 0 2px; padding-left: 20px; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.faq details { border-bottom: 1px solid var(--borde); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; color: var(--texto-suave); }
.pie__nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; font-weight: 600; color: var(--texto); }
.fuente__ficha { font-size: .84rem; }

.migas { font-size: .85rem; color: var(--texto-suave); margin-bottom: 16px; }
.migas ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.migas li + li::before { content: "›"; margin-right: 6px; }
.pagina { padding-block: 32px 48px; }
.pagina h1 { font-family: var(--fuente-titulo); font-size: clamp(1.7rem, 4.6vw, 2.4rem); line-height: 1.15; margin: 0 0 14px; }
.pagina h2 { font-family: var(--fuente-titulo); font-size: 1.4rem; margin: 36px 0 12px; }
.pagina h3 { font-size: 1.02rem; margin: 0 0 6px; }
.ficha-cab { border-left: 6px solid var(--color-partido, var(--borde)); padding-left: 16px; margin-bottom: 20px; }
.ficha-datos { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 14px 0; font-size: .94rem; }
.ficha-datos dt { color: var(--texto-suave); }
.ficha-datos dd { margin: 0; }
.posicion { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 14px 16px; margin-bottom: 10px; }
.posicion p { margin: 4px 0 0; font-size: .94rem; }
.posicion__opcion { color: var(--texto-suave); }
.posicion__fuente { font-size: .8rem; color: var(--texto-suave); font-style: italic; }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--acento-suave); border-radius: var(--radio); padding: 18px 20px; margin: 24px 0; }
.cta p { margin: 0; font-weight: 600; }
.cta .boton { text-decoration: none; }
.tabla-comp { border-collapse: collapse; width: 100%; min-width: 620px; font-size: .88rem; background: var(--superficie); }
.tabla-comp th, .tabla-comp td { border: 1px solid var(--borde); padding: 8px 10px; text-align: left; vertical-align: top; }
.tabla-comp th[scope="row"] { white-space: nowrap; border-left: 5px solid var(--color-partido, var(--borde)); }
.tabla-comp thead th { background: var(--superficie-2); }
.lista-partidos { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.lista-partidos a { display: block; text-decoration: none; background: var(--superficie); border: 1px solid var(--borde); border-left: 6px solid var(--color-partido); border-radius: var(--radio-s); padding: 14px 16px; }
.lista-partidos a:hover { border-color: var(--texto-suave); }
.lista-partidos strong { display: block; }
.lista-partidos span { font-size: .85rem; color: var(--texto-suave); }
.indice-temas { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 20px; padding: 0; list-style: none; }
.indice-temas a { display: inline-block; font-size: .85rem; padding: .3em .8em; border-radius: 999px; background: var(--acento-suave); text-decoration: none; }
.pagina h2, .pagina h3, .seo-bloque { scroll-margin-top: 72px; }
