/* css/desafio.css — la página /desafio. D4, 07/10/2026; D5, 08/10/2026.

   Sale de la maqueta de Claude («Desafío de MapaFut · maqueta», versión 4), que PF eligió
   como norte (07/10). Tokens de styles.css. Todas las clases empiezan con df-.

   ⚠️ COLORES (PF, 07/10): --color-desafio (naranja) es SOLO del desafío semanal: empezar,
   el reloj, el puntaje, la pregunta actual, tu fila, compartir. Todo lo que lleva al resto
   de MapaFut (un juego, el perfil) va en --color-accent (verde). */

.df [hidden] { display: none !important; }
.df {
    max-width: 560px;
    display: grid;
    gap: 14px;
    align-content: start;
    /* Lugar para que lo último suba por encima de la tuerca de ajustes, que queda fija abajo
       (con la barra, el cuerpo ya deja 72 px y el contenedor su margen). */
    padding-bottom: 24px;
    --df-naranja-suave: rgba(249, 115, 22, 0.14);
    --df-naranja-borde: rgba(249, 115, 22, 0.45);
    --df-bien-suave: rgba(52, 211, 153, 0.14);
    --df-mal-suave: rgba(239, 68, 68, 0.14);
}
.df-num { font-family: var(--font-datos); font-variant-numeric: tabular-nums; }

/* Mientras se responde, la pantalla es del juego: sin cabecera ni barra. */
body.df-jugando .top-bar,
body.df-jugando .barra,
body.df-jugando .ajustes { display: none; }
body.df-jugando.con-barra { padding-bottom: 0; }

/* ---------------------------------------------------------------- cabecera */
.df-cab { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.df-volver {
    width: 44px; height: 44px; flex: none;
    border-radius: 12px; border: 1px solid var(--color-border);
    display: grid; place-items: center;
    color: var(--color-text-secondary); background: transparent;
    font-size: 18px; text-decoration: none; cursor: pointer;
}
.df-volver:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }
.df-cab-txt { display: grid; gap: 3px; min-width: 0; }
.df-eyebrow { font-family: var(--font-datos); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-desafio); }
.df-cab-titulo { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-cab-puntos { margin-left: auto; text-align: right; display: grid; gap: 2px; }
.df-cab-puntos b { font-size: 18px; }
.df-cab-puntos span { font-size: 10px; color: var(--color-text-muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------------------------------------------------------------- piezas */
.df-tarjeta {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 10px;
}
.df-tarjeta-desafio {
    border-color: var(--df-naranja-borde);
    background: linear-gradient(180deg, var(--df-naranja-suave), var(--color-surface) 70%);
}
.df-solo { margin-top: 12px; }
.df-grande { margin: 0; font-size: 23px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.df-sub { margin: 0; font-size: 14px; line-height: 1.5; color: var(--color-text-secondary); }
.df-letra { margin: 0; font-size: 12px; line-height: 1.5; color: var(--color-text-muted); }
.df-cargando { color: var(--color-text-secondary); margin: 24px 0; }
.df-chip {
    justify-self: start; margin: 0;
    font-family: var(--font-datos); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 6px 9px; border-radius: 6px;
}
.df-chip-vivo { background: var(--df-naranja-suave); color: var(--color-desafio); }
.df-chip-gris { background: var(--color-surface-elevated); color: var(--color-text-secondary); }

.df-rotulo-reloj { font-family: var(--font-datos); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-secondary); }
.df-reloj { display: flex; gap: 8px; }
.df-reloj div {
    flex: 1; background: var(--color-surface-elevated); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 10px 0 8px; text-align: center; display: grid; gap: 4px;
}
.df-reloj b { font-family: var(--font-datos); font-size: 26px; line-height: 1.25; color: var(--color-desafio); }
.df-reloj span { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

.df-reglas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.df-reglas li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; font-size: 14px; line-height: 1.4; color: var(--color-text-secondary); }
.df-reglas b { font-size: 16px; color: var(--color-text-primary); text-align: center; background: var(--color-surface-elevated); border-radius: 10px; padding: 9px 0; }

/* Botones. Naranja = desafío. Verde = el resto de MapaFut. */
.df-btn {
    display: block; border: 0; border-radius: 12px; padding: 15px 16px; min-height: 48px;
    font: 700 15px var(--font-main); text-align: center; text-decoration: none; cursor: pointer;
}
.df-btn:disabled { opacity: 0.6; cursor: default; }
/* «Siguiente pregunta» está desde el principio, apagado hasta que respondés (PF, 09/10). */
.df-juego .df-btn-sec:disabled { opacity: 0.35; }
.df-ancho { width: 100%; }
.df-btn-desafio { background: var(--color-desafio); color: #1a0d03; }
.df-btn-sitio { background: var(--color-action); color: var(--color-on-action); }
.df-btn-sec { background: transparent; color: var(--color-text-primary); border: 1px solid var(--color-border); }
.df-link-sitio { color: var(--color-action); font-weight: 700; font-size: 14px; text-decoration: none; padding: 10px 0 10px 12px; }
.df-btn:focus-visible, .df-op:focus-visible, .df-volver:focus-visible, .df-cuadro:focus-visible, .df-tab:focus-visible, .df-link-sitio:focus-visible {
    outline: 2px solid var(--color-desafio); outline-offset: 2px;
}


/* ---------------------------------------------------------------- dos columnas en la computadora (D5)
   PF, 08/10: la pantalla final pedía bajar en la computadora; usar los costados. */
/* En el celular las dos columnas se deshacen (display: contents) y el orden lo dan las
   clases df-o1… (la pantalla final: puntaje, la tarjeta para compartir, cómo vas, el repaso). */
.df-columnas { display: grid; gap: 14px; align-content: start; }
.df-col { display: contents; }
.df-o1 { order: 1; } .df-o2 { order: 2; } .df-o3 { order: 3; } .df-o4 { order: 4; } .df-o5 { order: 5; } .df-o6 { order: 6; }
@media (min-width: 900px) {
    .df.df-ancha { max-width: 1080px; }
    .df-columnas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
    .df-col { display: grid; gap: 14px; align-content: start; }
    .df-columnas.df-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
    .df-columnas.df-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
.df-actualizar {
    margin-left: auto; flex: none; min-height: 40px; padding: 0 12px;
    border-radius: 12px; border: 1px solid var(--color-border); background: transparent;
    color: var(--color-text-secondary); font: 600 13px var(--font-main); cursor: pointer;
}
.df-actualizar:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }
.df-actualizar:focus-visible { outline: 2px solid var(--color-desafio); outline-offset: 2px; }

/* ---------------------------------------------------------------- la pregunta
   D5 (PF, 08/10): entra entera en la pantalla. El lienzo ya no estira: mide lo que su
   contenido. En la computadora, enunciado a la izquierda y opciones a la derecha. */
.df-juego { display: flex; flex-direction: column; gap: 8px; }
.df-preg-a, .df-preg-b { display: contents; }
/* PF (08/10): las opciones, centradas a la altura de la imagen. El número, la dificultad y
   el enunciado van arriba, de lado a lado; abajo, el dibujo y las opciones, una frente a la otra. */
@media (min-width: 900px) {
    .df-juego {
        display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 28px; row-gap: 12px;
        grid-template-areas: "cab cab" "prog prog" "pcab pcab" "enun enun" "lienzo ops";
    }
    .df-juego > .df-cab { grid-area: cab; }
    .df-juego > .df-progreso { grid-area: prog; }
    .df-juego .df-preg-cab { grid-area: pcab; }
    .df-juego .df-enunciado { grid-area: enun; }
    .df-juego .df-lienzo { grid-area: lienzo; }
    .df-preg-b { grid-area: ops; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
    .df-preg-b .df-op { min-height: 58px; }
}
.df-progreso { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.df-progreso i { height: 5px; border-radius: 3px; background: var(--color-surface-elevated); }
.df-progreso .bien { background: var(--color-success); }
.df-progreso .mal { background: var(--color-error); }
.df-progreso .ahora { background: var(--color-desafio); }
.df-preg-cab { display: flex; justify-content: space-between; align-items: center; }
.df-preg-num { font-family: var(--font-datos); font-size: 12px; color: var(--color-text-secondary); }
/* La escala de dificultad del sitio (--nivel-*), la misma de las pantallas de niveles. */
.df-dif { font-family: var(--font-datos); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; padding: 5px 7px; border-radius: 5px; border: 1px solid currentColor; }
.df-dif-1 { color: var(--nivel-1); }
.df-dif-2 { color: var(--nivel-2); }
.df-dif-3 { color: var(--nivel-3); }
.df-enunciado { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; text-wrap: balance; }

.df-lienzo {
    position: relative; min-height: 150px;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px;
    display: grid; place-items: center; align-content: center; gap: 12px; padding: 14px 16px;
}
/* La caja de la imagen se reserva antes de que llegue (regla del 12/09). */
.df-img { width: auto; height: 128px; max-width: 70%; object-fit: contain; opacity: 0; transition: opacity 0.2s; }
.df-lienzo.cargada .df-img { opacity: 1; }
.df-lienzo-bandera .df-img, .df-lienzo-estadio .df-img { height: auto; width: 100%; max-width: 100%; max-height: 190px; border-radius: 8px; }
@media (min-width: 900px) {
    /* PF (09/10): el dibujo mide lo mismo en todas las preguntas, con o sin foto, y no cambia
       al responder. 330 = la foto del estadio (300) + el relleno y el borde. Antes el piso era
       260 y el dibujo se estiraba hasta el alto de las opciones cuando aparecía «Siguiente
       pregunta» (318), y volvía a 260 en la pregunta siguiente. El botón ahora está siempre
       (apagado hasta responder), así que la columna de las opciones no cambia de alto. */
    .df-lienzo { min-height: 330px; }
    .df-img { height: 190px; }
    .df-lienzo-estadio .df-img { max-height: 300px; }
    /* La carrera, centrada en el dibujo, no pegada arriba: el mismo relleno abajo que arriba
       (el de arriba deja lugar al reloj). Las de más de 12 clubes ya llenan el dibujo. */
    .df-juego .df-lienzo-trayectoria { align-content: center; }
    .df-juego .df-lienzo-trayectoria:not(:has(li:nth-child(13))) { padding-bottom: 60px; }
}
/* «¿Quién salió campeón?»: el torneo, grande. */
.df-torneo { display: grid; justify-items: center; gap: 6px; text-align: center; }
.df-copa { font-size: 34px; line-height: 1; }
.df-torneo b { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
/* «¿Qué DT salió campeón con estos clubes?»: los escudos, uno al lado del otro. */
.df-dt-clubes { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 22px; }
.df-dt-clubes .df-pase-club { max-width: 110px; }
.df-temp { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; z-index: 1; }
.df-temp svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.df-temp .fondo { stroke: var(--color-surface-elevated); }
.df-temp .arco { stroke: var(--color-desafio); transition: stroke-dashoffset 0.25s linear; }
.df-temp b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; }
.df-temp.poco .arco { stroke: var(--color-error); }
.df-temp.poco b { color: var(--color-error); }

.df-pase { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; width: 100%; }
.df-pase-club { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 13px; }
.df-pase-club img { width: 56px; height: 56px; object-fit: contain; }
.df-pase-club span { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.df-flecha { font-family: var(--font-datos); font-size: 22px; font-weight: 700; color: var(--color-desafio); }
.df-pase-datos { display: flex; gap: 8px; justify-content: center; }
.df-pase-datos div { background: var(--color-surface-elevated); border-radius: 10px; padding: 8px 14px; display: grid; gap: 3px; text-align: center; }
.df-pase-datos b { font-size: 16px; }
.df-pase-datos span { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.df-lienzo-trayectoria { place-items: start; align-content: start; padding-top: 60px; }
/* La carrera, en fichas que se acomodan solas: entra entera aunque tenga diez clubes. */
.df-carrera { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; width: 100%; }
.df-carrera li { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 8px; background: var(--color-surface-elevated); border-radius: 8px; }
.df-carrera-esc { width: 20px; height: 20px; object-fit: contain; flex: none; align-self: center; }
.df-carrera li { align-items: center; }
.df-carrera li .df-num { color: var(--color-text-secondary); font-size: 11px; font-weight: 500; }
/* Carreras largas (más de 6 clubes): en dos columnas, para que la pregunta entre sin bajar. */
.df-carrera.larga { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.df-carrera.larga li { min-width: 0; font-size: 12px; gap: 5px; padding: 4px 6px; }
.df-carrera.larga li span:not(.df-num) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-carrera.larga li .df-num { font-size: 10px; flex: none; }
.df-carrera.larga .df-carrera-esc { width: 16px; height: 16px; }
/* Las larguísimas (hay una de 25 clubes): en el celular la lista se desplaza adentro de su
   caja y las opciones quedan siempre a la vista. */
@media (max-width: 899px) {
    .df-carrera { max-height: max(150px, calc(100dvh - 500px)); overflow-y: auto; }
}
.df-jugador { margin: 0; font-size: 26px; font-weight: 800; text-align: center; text-wrap: balance; }

.df-aviso-tiempo { margin: 0; min-height: 0; font-size: 14px; font-weight: 700; color: var(--color-error); }
.df-aviso-tiempo:empty { display: none; }
.df-ops { display: grid; gap: 7px; }
.df-op {
    display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center;
    width: 100%; min-height: 48px; padding: 8px 12px;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
    color: var(--color-text-primary); font: 600 15px var(--font-main); text-align: left; cursor: pointer;
}
.df-op:hover:not(:disabled) { background: var(--color-surface-hover); }
.df-op:disabled { cursor: default; }
.df-op-l { font-family: var(--font-datos); font-size: 12px; font-weight: 700; color: var(--color-text-muted); width: 28px; height: 28px; border-radius: 7px; background: var(--color-surface-elevated); display: grid; place-items: center; }
.df-op-txt { min-width: 0; overflow-wrap: anywhere; }
.df-op-pts { font-family: var(--font-datos); font-size: 13px; font-weight: 700; }
.df-op.elegida { border-color: var(--color-text-secondary); }
.df-op.bien { border-color: var(--color-success); background: var(--df-bien-suave); }
.df-op.bien .df-op-l { background: var(--color-success); color: var(--color-bg); }
.df-op.bien .df-op-pts { color: var(--color-success); }
.df-op.mal { border-color: var(--color-error); background: var(--df-mal-suave); }
.df-op.mal .df-op-l { background: var(--color-error); color: var(--color-bg); }
.df-op.apagada { opacity: 0.45; }

/* ¿Salir? */
.df-capa { position: fixed; inset: 0; background: rgba(5, 8, 6, 0.7); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.df-hoja {
    width: 100%; max-width: 560px; background: var(--color-surface); border-top: 1px solid var(--df-naranja-borde);
    border-radius: 22px 22px 0 0; padding: 20px 16px calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px;
}
.df-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------------------------------------------------------- terminaste */
.df-resultado { text-align: center; display: grid; gap: 6px; padding: 10px 0 2px; }
.df-puntos { font-size: 52px; font-weight: 700; line-height: 1.25; color: var(--color-desafio); letter-spacing: -0.02em; }
.df-tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.df-tres div { background: var(--color-surface-elevated); border-radius: 12px; padding: 10px 6px; text-align: center; display: grid; gap: 4px; }
.df-tres b { font-size: 18px; }
.df-tres span { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.df-repaso { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.df-cuadro {
    aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 9px; cursor: pointer;
    font-family: var(--font-datos); font-size: 12px; font-weight: 700; min-height: 44px;
}
.df-cuadro.bien { background: var(--df-bien-suave); color: var(--color-success); }
.df-cuadro.mal { background: var(--df-mal-suave); color: var(--color-error); }
.df-cuadro.on { outline: 2px solid currentColor; outline-offset: 1px; }
@media (min-width: 900px) {
    .df-cuadro { aspect-ratio: auto; height: 46px; }
    .df-columnas .df-reloj div { padding: 7px 0 6px; }
    .df-columnas .df-reloj b { font-size: 22px; }
}
.df-detalle b { font-size: 15px; }
.df-detalle-ops { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.df-detalle-ops li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; font-size: 14px; padding: 6px 8px; border-radius: 10px; }
.df-detalle-ops li.bien { background: var(--df-bien-suave); }
.df-detalle-ops li.mal { background: var(--df-mal-suave); }
/* Compartir: la tarjeta GRANDE y el botón debajo (PF, 08/10: «que el diseño te lleve e
   invite a compartir»). En el celular, todo el ancho; en la computadora, la columna, sin
   pasarse del alto de la pantalla. La tarjeta es 4:5. */
.df-compartir { display: grid; gap: 12px; justify-items: center; }
.df-tarjeta-vista {
    display: block; width: 100%; max-width: 460px; aspect-ratio: 4 / 5; height: auto;
    border-radius: 16px; border: 1px solid var(--df-naranja-borde); background: var(--color-surface);
    box-shadow: 0 18px 50px -20px rgba(249, 115, 22, 0.55);
}
.df-compartir:not(.lista) .df-tarjeta-vista { visibility: hidden; }
.df-compartir .df-btn-compartir { width: 100%; max-width: 460px; font-size: 16px; min-height: 54px; }
.df-compartir .df-letra { text-align: center; }
@media (min-width: 900px) {
    .df-tarjeta-vista, .df-compartir .df-btn-compartir { width: min(100%, calc((100dvh - 330px) * 0.8)); }
    /* En la columna de un tercio, la tarjeta ocupa todo el ancho de la columna. */
    .df-2-1 .df-tarjeta-vista, .df-2-1 .df-compartir .df-btn-compartir,
    .df-1-2 .df-tarjeta-vista, .df-1-2 .df-compartir .df-btn-compartir { width: 100%; }
}
/* La lista de la tabla completa, con el mismo fondo que las tablas del perfil. */
.td-lista .df-filas { gap: 6px; }
.df-sabes { font-size: 16px; color: var(--color-text-primary); font-weight: 600; }

/* ---------------------------------------------------------------- la tabla */
.df-proxima { justify-self: start; }
.df-tabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
}
.df-tab {
    min-height: 40px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
    color: var(--color-text-secondary); font: 600 13px var(--font-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
}
.df-tab.on { background: var(--color-surface-elevated); color: var(--color-text-primary); }
.df-sep { text-align: center; color: var(--color-text-muted); font-family: var(--font-datos); letter-spacing: 0.3em; }
.df-pie-tabla { display: grid; gap: 10px; }
.df-ver-mas { border: 0; background: transparent; color: var(--color-text-secondary); font: 700 14px var(--font-main); min-height: 44px; cursor: pointer; }

.df-anterior { display: grid; gap: 12px; margin-top: 10px; }
.df-anterior-titulo { font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
    .df-temp .arco, .df-img { transition: none; }
}
