/*
Theme Name: Euskeratik
Theme URI: https://euskeratik.eus
Author: Hashim
Description: App de aprendizaje de euskera con cuentas de usuario, progreso multidispositivo y contenido multiidioma (euskera, español, inglés, francés).
Version: 3.0.0
Text Domain: euskeratik
*/

/* ==========================================================
   FUENTES PROPIAS
   Alojadas en este servidor, no en Google. Así la app carga
   más rápido y no se envía la IP de los usuarios a terceros.
   Ambas son de código abierto (licencia SIL Open Font).
   ========================================================== */

@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('assets/fonts/bricolage-grotesque.woff2') format('woff2-variations'),
         url('assets/fonts/bricolage-grotesque.woff2') format('woff2');
    font-weight: 200 800;
    font-stretch: 75% 100%;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Instrument Sans';
    src: url('assets/fonts/instrument-sans.woff2') format('woff2-variations'),
         url('assets/fonts/instrument-sans.woff2') format('woff2');
    font-weight: 400 700;
    font-stretch: 75% 100%;
    font-style: normal;
    font-display: swap;
}


:root {
    --ek-gorria: #E24B4A;
    --ek-berdea: #639922;
    --ek-zuria: #F5F3EC;
    --ek-urdin-iluna: #0B3556;
    --ek-blanco: #FEFEFC;
    --ek-gris-texto: #5F5E5A;
    --ek-gris-claro: #A8A69E;
    --ek-borde: #E4E1D8;
    --font-titulos: 'Bricolage Grotesque', sans-serif;
    --font-cuerpo: 'Instrument Sans', sans-serif;
}

* { box-sizing: border-box; }

body {
    /* El tamaño óptico se ajusta solo al tamaño del texto */
    font-optical-sizing: auto;
    margin: 0;
    background: var(--ek-zuria);
    font-family: var(--font-cuerpo);
    color: #232320;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Contenedor de la app ---------- */
.ek-app {
    max-width: 440px;
    margin: 0 auto;
    padding: 22px 18px 0;
}

/* ---------- Cabecera ---------- */
.ek-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.ek-saludo {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 26px;
    margin: 0;
    letter-spacing: -0.5px;
}

.ek-lema {
    font-size: 14px;
    color: var(--ek-gris-texto);
    margin: 2px 0 0;
}

.ek-cabecera-dcha {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ek-racha {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    font-weight: 500;
    color: #232320;
}

.ek-llama { color: var(--ek-gorria); font-size: 15px; }

.ek-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ek-urdin-iluna);
    color: #FEFEFC;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 17px;
}

/* ---------- Traducciones (toggle) ---------- */
.ek-trad {
    font-size: 11px;
    color: var(--ek-gris-claro);
    margin: 1px 0 0;
}
.ek-trad-centro { text-align: center; }

/* ---------- Tarjetas ---------- */
.ek-tarjeta {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
}

.ek-etiqueta { font-size: 13px; color: var(--ek-gris-texto); margin: 0; }
.ek-etiqueta-peq { font-size: 12px; color: var(--ek-gris-texto); margin: 0; }

.ek-titulo-tarjeta {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 24px;
    margin: 4px 0 12px;
    letter-spacing: -0.4px;
}

/* ---------- Progreso ---------- */
.ek-progreso-fila { display: flex; align-items: center; gap: 14px; }
.ek-progreso-texto { flex: 1; min-width: 0; }

.ek-barra {
    width: 100%;
    height: 9px;
    background: #EDEBE3;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ek-barra-relleno {
    height: 100%;
    background: var(--ek-berdea);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.ek-anillo { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
#ek-anillo-progreso { transition: stroke-dashoffset 0.6s ease; }

.ek-anillo-texto {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ek-anillo-num { font-family: var(--font-titulos); font-weight: 600; font-size: 20px; }
.ek-anillo-lab { font-size: 10px; color: var(--ek-gris-texto); }

/* ---------- Objetivo diario ---------- */
.ek-objetivo-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 4px;
    gap: 10px;
}

.ek-objetivo-texto { font-size: 17px; font-weight: 500; margin: 0; }

.ek-contador {
    background: #FBEDE9;
    color: #7A2618;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ---------- Botones ---------- */
.ek-boton-primario {
    width: 100%;
    background: var(--ek-gorria);
    color: #FFF3F2;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-family: var(--font-cuerpo);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ek-boton-primario:active { transform: scale(0.99); }

.ek-boton-secundario {
    width: 100%;
    background: transparent;
    color: #232320;
    border: 0.5px solid var(--ek-borde);
    border-radius: 12px;
    padding: 13px;
    font-family: var(--font-cuerpo);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.ek-flecha { font-size: 17px; }

/* ---------- Secciones ---------- */
.ek-seccion-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 22px 0 12px;
}

.ek-seccion-titulo {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 19px;
    margin: 0;
}

.ek-enlace-rojo {
    color: var(--ek-gorria);
    font-size: 14px;
    text-decoration: none;
    padding-top: 4px;
}

/* ---------- Categorías ---------- */
.ek-categorias {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ek-cat {
    border-radius: 16px;
    padding: 16px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
}

.ek-cat-nombre { font-family: var(--font-titulos); font-weight: 600; font-size: 17px; margin: 0; }
.ek-cat-dato { font-size: 12px; margin: 2px 0 0; opacity: 0.85; }
.ek-cat-trad { font-size: 10px; margin: 1px 0 0; opacity: 0.6; }

.ek-cat-rojo { background: var(--ek-gorria); color: #FFF3F2; }
.ek-cat-verde { background: var(--ek-berdea); color: #F2F8E9; }
.ek-cat-claro { background: #EDEBE3; color: #232320; }
.ek-cat-azul { background: var(--ek-urdin-iluna); color: #EAF2F9; }

/* ---------- Tarjeta de unidad ---------- */
.ek-migas {
    font-size: 11px;
    font-weight: 500;
    color: var(--ek-berdea);
    letter-spacing: 0.5px;
    margin: 0 0 6px;
}

.ek-unidad-titulo {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 19px;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}

.ek-unidad-fila {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.ek-porcentaje {
    color: var(--ek-berdea);
    font-size: 17px;
    font-weight: 600;
    font-family: var(--font-titulos);
}

/* ---------- Banner ---------- */
.ek-banner {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.ek-banner-icono {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ek-gorria);
    color: #FFF3F2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.ek-banner-texto { font-size: 15px; font-weight: 500; margin: 0; }
.ek-banner-texto-sec { font-size: 15px; color: var(--ek-gris-texto); margin: 0; }

/* ---------- Navegación inferior ---------- */
.ek-espacio-nav { height: 100px; }

.ek-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 36px);
    max-width: 404px;
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 22px;
    display: flex;
    justify-content: space-around;
    padding: 11px 6px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.05);
}

.ek-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: var(--ek-gris-claro);
    text-decoration: none;
    line-height: 1.25;
}

.ek-nav-icono { font-size: 17px; margin-bottom: 2px; }
.ek-nav-eu { font-size: 11px; font-weight: 500; }
.ek-nav-trad { font-size: 9px; opacity: 0.75; }
.ek-nav-activo { color: var(--ek-gorria); }

/* ---------- Pantallas simples (login, registro, bienvenida) ---------- */
.ek-pantalla {
    max-width: 440px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--ek-blanco);
    padding: 32px 22px;
}

.ek-logo {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: var(--ek-urdin-iluna);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ek-titulo {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 22px;
    text-align: center;
    margin: 0 0 4px;
}

.ek-subtitulo {
    font-size: 12px;
    text-align: center;
    color: var(--ek-gris-claro);
    margin: 0 0 26px;
}

.ek-campo-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ek-gris-texto);
    margin: 0 0 5px;
    display: block;
}

.ek-input {
    width: 100%;
    border: 0.5px solid var(--ek-borde);
    border-radius: 11px;
    padding: 13px;
    font-family: var(--font-cuerpo);
    font-size: 14px;
    margin-bottom: 15px;
    background: var(--ek-blanco);
}

.ek-input:focus { outline: 2px solid var(--ek-gorria); outline-offset: -2px; }

.ek-enlace-secundario {
    font-size: 13px;
    text-align: center;
    color: var(--ek-gris-texto);
    margin: 14px 0 0;
}

.ek-enlace-secundario a { color: var(--ek-gorria); font-weight: 500; text-decoration: none; }

.ek-traduccion {
    font-size: 11px;
    text-align: center;
    color: var(--ek-gris-claro);
    margin: 3px 0 0;
}

.ek-error {
    color: #A32D2D;
    font-size: 13px;
    margin: -6px 0 12px;
    display: none;
}

.ek-racha-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FBEDE9;
    color: #7A2618;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

/* ==========================================================
   LECCIÓN
   ========================================================== */

.ek-lec-top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.ek-lec-salir { font-size: 24px; color: var(--ek-gris-claro); text-decoration: none; line-height: 1; }
.ek-lec-top .ek-barra { margin-bottom: 0; flex: 1; }
.ek-lec-vidas { color: var(--ek-gorria); font-size: 14px; font-weight: 500; }

.ek-lec-palabra {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 34px;
    margin: 16px 0 24px;
    letter-spacing: -0.5px;
}

.ek-lec-opcion {
    border: 0.5px solid var(--ek-borde);
    background: var(--ek-blanco);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    font-size: 15px;
    cursor: pointer;
}

.ek-lec-opcion:active { transform: scale(0.99); }

.ek-lec-ok { border: 2px solid var(--ek-berdea); background: #F0F6E6; color: #2C4A0A; font-weight: 500; }
.ek-lec-mal { border: 2px solid var(--ek-gorria); background: #FBEDE9; color: #7A2618; }

.ek-lec-feedback {
    border-radius: 12px;
    padding: 14px;
    margin: 16px 0;
    display: none;
    font-size: 14px;
}

.ek-lec-feedback-ok { background: #F0F6E6; color: #2C4A0A; }
.ek-lec-feedback-mal { background: #FBEDE9; color: #7A2618; }
.ek-lec-nota { font-size: 12px; opacity: 0.85; }

/* Fase de aprender */
.ek-badge-nueva {
    display: inline-block;
    background: #FBEDE9;
    color: #7A2618;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 20px;
}

.ek-ap-traduccion { font-size: 19px; color: var(--ek-gris-texto); margin: -12px 0 16px; }

.ek-ap-nota {
    background: #F5F3EC;
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    color: var(--ek-gris-texto);
    margin-bottom: 20px;
}

.ek-ap-contador { text-align: center; font-size: 12px; color: var(--ek-gris-claro); margin: 0 0 14px; }

/* Pista al tocar la palabra */
.ek-lec-clicable {
    cursor: pointer;
    border-bottom: 2px dashed var(--ek-borde);
    display: inline-block;
}

.ek-pista-aviso { font-size: 11px; color: var(--ek-gris-claro); margin: 0 0 18px; }

.ek-pista {
    background: #F5F3EC;
    border-radius: 12px;
    padding: 13px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

/* ==========================================================
   HIZTEGIA (diccionario)
   ========================================================== */

.ek-hiz-cabecera { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ek-hiz-volver { font-size: 22px; color: #232320; text-decoration: none; line-height: 1; }

.ek-hiz-filtros {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
}

.ek-hiz-filtro {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 20px;
    padding: 8px 16px;
    font-family: var(--font-cuerpo);
    font-size: 13px;
    color: var(--ek-gris-texto);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.ek-hiz-filtro-trad { font-size: 9px; opacity: 0.7; }

.ek-hiz-filtro-activo {
    background: var(--ek-gorria);
    border-color: var(--ek-gorria);
    color: #FFF3F2;
    font-weight: 500;
}

.ek-hiz-total { font-size: 12px; color: var(--ek-gris-claro); margin: 0 0 12px; }

.ek-hiz-grupo {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 15px;
    margin: 20px 0 10px;
}

.ek-hiz-grupo-trad {
    font-family: var(--font-cuerpo);
    font-weight: 400;
    font-size: 11px;
    color: var(--ek-gris-claro);
}

.ek-hiz-item {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 8px;
}

.ek-hiz-con-nota { cursor: pointer; }

.ek-hiz-fila {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.ek-hiz-eu { font-family: var(--font-titulos); font-weight: 600; font-size: 16px; }
.ek-hiz-trad { font-size: 14px; color: var(--ek-gris-texto); text-align: right; }

.ek-hiz-nota {
    font-size: 12px;
    color: var(--ek-gris-claro);
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 0.5px solid var(--ek-borde);
    display: none;
}

.ek-hiz-abierto .ek-hiz-nota { display: block; }

.ek-hiz-vacio {
    text-align: center;
    padding: 40px 0;
    color: var(--ek-gris-texto);
    font-size: 14px;
}

/* ==========================================================
   IKASTAROAK (mapa de unidades)
   ========================================================== */

.ek-map-unidad {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
}

.ek-map-bloqueada { opacity: 0.55; }

.ek-map-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ek-map-titulo { font-family: var(--font-titulos); font-weight: 600; font-size: 18px; margin: 0; }
.ek-map-trad { font-size: 11px; color: var(--ek-gris-claro); margin: 1px 0 0; }

.ek-map-contador {
    background: #F5F3EC;
    color: var(--ek-gris-texto);
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}

.ek-map-nodos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.ek-map-nodo {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}

.ek-map-nodo-ok { background: var(--ek-berdea); color: #F2F8E9; }
.ek-map-nodo-activo { background: var(--ek-gorria); color: #FFF3F2; box-shadow: 0 0 0 4px #FBEDE9; }
.ek-map-nodo-cerrado { background: #F5F3EC; border: 0.5px solid var(--ek-borde); color: var(--ek-gris-claro); }

.ek-map-aviso { font-size: 12px; color: var(--ek-gris-texto); margin: 14px 0 0; text-align: center; }

/* ==========================================================
   PROFILA (perfil y ajustes)
   ========================================================== */

.ek-perfil-tarjeta { text-align: center; }

.ek-avatar-grande {
    width: 68px;
    height: 68px;
    font-size: 26px;
    margin: 0 auto 12px;
}

.ek-perfil-nombre {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 20px;
    margin: 0 0 18px;
}

.ek-perfil-datos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    border-top: 0.5px solid var(--ek-borde);
    padding-top: 16px;
}

.ek-perfil-dato { text-align: center; }

.ek-perfil-num {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 22px;
    margin: 0;
}

.ek-perfil-lab {
    font-size: 12px;
    color: var(--ek-gris-texto);
    margin: 1px 0 0;
}

.ek-perfil-dato .ek-trad { font-size: 10px; }

/* ---------- Filas de ajuste ---------- */
.ek-ajuste {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.ek-ajuste-texto { flex: 1; min-width: 0; }

.ek-ajuste-titulo {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.ek-ajuste-aviso {
    font-size: 11px;
    color: var(--ek-berdea);
    margin: 12px 0 0;
    text-align: center;
    min-height: 14px;
}

/* ---------- Interruptor ---------- */
.ek-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 29px;
    flex-shrink: 0;
}

.ek-switch input { opacity: 0; width: 0; height: 0; }

.ek-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #DCD9CF;
    border-radius: 29px;
    transition: background 0.25s;
}

.ek-switch-slider:before {
    content: "";
    position: absolute;
    height: 23px;
    width: 23px;
    left: 3px;
    bottom: 3px;
    background: var(--ek-blanco);
    border-radius: 50%;
    transition: transform 0.25s;
}

.ek-switch input:checked + .ek-switch-slider { background: var(--ek-berdea); }
.ek-switch input:checked + .ek-switch-slider:before { transform: translateX(21px); }

/* ---------- Selector de idioma ---------- */
.ek-idiomas { display: flex; flex-direction: column; gap: 8px; }

.ek-idioma-op {
    border: 0.5px solid var(--ek-borde);
    border-radius: 12px;
    padding: 13px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.ek-idioma-eu { font-size: 11px; color: var(--ek-gris-claro); }

.ek-idioma-activo {
    border: 2px solid var(--ek-gorria);
    background: #FBEDE9;
    font-weight: 500;
}

.ek-idioma-activo .ek-idioma-eu { color: #A32D2D; }

/* ---------- Botón de peligro ---------- */
.ek-boton-peligro {
    width: 100%;
    background: transparent;
    color: var(--ek-gorria);
    border: 0.5px solid var(--ek-gorria);
    border-radius: 12px;
    padding: 14px;
    font-family: var(--font-cuerpo);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
}

.ek-boton-peligro:active { background: #FBEDE9; }

/* ==========================================================
   EJERCICIO DE ESCRIBIR
   ========================================================== */

.ek-input-respuesta {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 20px;
    text-align: center;
    padding: 16px;
    margin-bottom: 14px;
}

.ek-input-ok {
    border: 2px solid var(--ek-berdea);
    background: #F0F6E6;
    color: #2C4A0A;
}

.ek-input-mal {
    border: 2px solid var(--ek-gorria);
    background: #FBEDE9;
    color: #7A2618;
}

.ek-input-respuesta:disabled { opacity: 1; }

/* ==========================================================
   REPASO ESPACIADO
   ========================================================== */

.ek-badge-repaso {
    display: inline-block;
    background: #E8F0F7;
    color: #0B3556;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.ek-repaso-tarjeta {
    background: var(--ek-urdin-iluna);
    border: none;
    color: #EAF2F9;
}

.ek-repaso-tarjeta .ek-ajuste-titulo { color: #EAF2F9; }
.ek-repaso-tarjeta .ek-trad { color: #9FC4E0; }

.ek-repaso-num {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 30px;
    margin: 0;
    color: #EAF2F9;
}

.ek-boton-claro {
    width: 100%;
    background: #EAF2F9;
    color: var(--ek-urdin-iluna);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: var(--font-cuerpo);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    margin-top: 14px;
}

/* ==========================================================
   ESTATISTIKAK (estadísticas y logros)
   ========================================================== */

.ek-est-rejilla {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}

.ek-est-caja {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.ek-est-num {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 28px;
    margin: 0;
    letter-spacing: -0.5px;
}

.ek-est-verde { color: var(--ek-berdea); }
.ek-est-rojo { color: var(--ek-gorria); }

.ek-est-lab {
    font-size: 13px;
    color: var(--ek-gris-texto);
    margin: 2px 0 0;
}

.ek-est-caja .ek-trad { font-size: 10px; }

/* Barra de dominio */
.ek-dominio-barra {
    display: flex;
    width: 100%;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: #EDEBE3;
    margin-bottom: 14px;
}

.ek-dominio-parte { height: 100%; transition: width 0.5s ease; }
.ek-dom-nuevo { background: #E4E1D8; }
.ek-dom-medio { background: #BA9A17; }
.ek-dom-alto { background: var(--ek-berdea); }

.ek-dominio-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--ek-gris-texto);
}

.ek-dominio-leyenda b { color: #232320; margin-left: 2px; }

.ek-punto {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 5px;
}

.ek-punto-nuevo { background: #E4E1D8; }
.ek-punto-medio { background: #BA9A17; }
.ek-punto-alto { background: var(--ek-berdea); }

/* Progreso por unidad */
.ek-est-fila { margin-bottom: 16px; }
.ek-est-fila:last-child { margin-bottom: 0; }

.ek-est-fila-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.ek-est-fila-nombre {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 15px;
}

.ek-est-fila-pct {
    font-size: 13px;
    color: var(--ek-gris-texto);
}

.ek-est-fila-trad {
    font-size: 11px;
    color: var(--ek-gris-claro);
    margin: 1px 0 6px;
}

/* Logros */
.ek-logros {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ek-logro {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 16px;
    padding: 16px 14px;
    text-align: center;
    opacity: 0.45;
}

.ek-logro-ok {
    opacity: 1;
    border: 1px solid var(--ek-berdea);
    background: #F5F9EF;
}

.ek-logro-icono {
    font-size: 22px;
    color: var(--ek-gris-claro);
    display: block;
    margin-bottom: 6px;
}

.ek-logro-ok .ek-logro-icono { color: var(--ek-berdea); }

.ek-logro-eu {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

.ek-logro-txt {
    font-size: 11px;
    color: var(--ek-gris-claro);
    margin: 3px 0 0;
    line-height: 1.35;
}

/* ==========================================================
   MAILA TESTA (test de nivel)
   ========================================================== */

.ek-test-icono {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ek-urdin-iluna);
    color: #EAF2F9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto;
}

.ek-test-nivel {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 52px;
    color: var(--ek-berdea);
    margin: 14px 0 2px;
    letter-spacing: -1px;
}

#ek-test-intro .ek-boton-secundario { margin-top: 10px; }

/* ==========================================================
   NIVEL MCER Y COMPETENCIAS
   ========================================================== */

.ek-mcer-tarjeta {
    background: var(--ek-urdin-iluna);
    border: none;
    color: #EAF2F9;
}

.ek-mcer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ek-mcer-lab { font-size: 13px; color: #9FC4E0; margin: 0; }
.ek-mcer-tarjeta .ek-trad { color: #7FAFD0; }

.ek-mcer-nivel {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 34px;
    margin: 0;
    color: #EAF2F9;
    letter-spacing: -1px;
}

.ek-mcer-barra {
    width: 100%;
    height: 9px;
    background: #123E63;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ek-mcer-relleno {
    height: 100%;
    background: #97C459;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.ek-mcer-pie { font-size: 12px; color: #9FC4E0; margin: 0; }

/* Competencias */
.ek-comp { margin-bottom: 18px; }
.ek-comp:last-child { margin-bottom: 0; }

.ek-comp-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.ek-comp-nombre {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 15px;
}

.ek-comp-pct {
    font-size: 13px;
    color: var(--ek-berdea);
    font-weight: 500;
}

.ek-comp-trad { margin: 1px 0 7px; }

.ek-comp-inactiva { opacity: 0.4; }
.ek-comp-inactiva .ek-comp-pct { color: var(--ek-gris-claro); }

/* ==========================================================
   PWA (instalación y estado sin conexión)
   ========================================================== */

.ek-offline {
    background: #FBEDE9;
    color: #7A2618;
    font-size: 12px;
    text-align: center;
    padding: 9px 12px;
    border-radius: 10px;
    margin: 0 0 14px;
}

.ek-instalar-tarjeta {
    background: #F0F6E6;
    border: 1px solid var(--ek-berdea);
}

.ek-boton-instalar {
    background: var(--ek-berdea);
    color: #F2F8E9;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-family: var(--font-cuerpo);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

/* En modo app instalada, algo más de aire arriba por la barra de estado */
@media (display-mode: standalone) {
    .ek-app { padding-top: 34px; }
    .ek-pantalla { padding-top: 44px; }
}

/* Aviso de error en los ajustes */
.ek-aviso-rojo { color: var(--ek-gorria) !important; }

/* ==========================================================
   EJERCICIO DE ORDENAR PALABRAS
   ========================================================== */

.ek-lec-frase {
    font-size: 22px;
    line-height: 1.35;
}

.ek-ordenar-linea {
    min-height: 62px;
    border-bottom: 2px dashed var(--ek-borde);
    padding: 8px 0 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.ek-ordenar-banco {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    min-height: 44px;
}

.ek-ficha {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 15px;
    color: #232320;
    cursor: pointer;
    box-shadow: 0 2px 0 var(--ek-borde);
}

.ek-ficha:active { transform: translateY(1px); box-shadow: none; }

.ek-ficha-usada {
    opacity: 0.25;
    pointer-events: none;
    box-shadow: none;
}

.ek-ficha-puesta { background: #F5F3EC; }

.ek-ficha-ok {
    border: 2px solid var(--ek-berdea);
    background: #F0F6E6;
    color: #2C4A0A;
}

.ek-ficha-mal {
    border: 2px solid var(--ek-gorria);
    background: #FBEDE9;
    color: #7A2618;
}

.ek-ordenar-acciones {
    display: flex;
    gap: 10px;
}

.ek-ordenar-acciones .ek-boton-secundario { flex: 1; }
.ek-ordenar-acciones .ek-boton-primario { flex: 2; }

/* Icono de la pantalla final de lección */
.ek-fin-icono {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ek-berdea);
    color: #F2F8E9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto;
}

/* ==========================================================
   MOVIMIENTO Y TRANSICIONES
   Todo breve (150-250ms) para que la app se sienta ágil,
   nunca lenta. Se desactiva si el usuario pide menos movimiento.
   ========================================================== */

@keyframes ek-entrar {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@keyframes ek-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.035); }
    100% { transform: scale(1); }
}

@keyframes ek-temblar {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

@keyframes ek-aparecer {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Entrada escalonada de las tarjetas --- */
.ek-app > .ek-tarjeta,
.ek-app > .ek-categorias,
.ek-app > .ek-banner,
.ek-app > .ek-est-rejilla,
.ek-app > .ek-logros,
.ek-map-unidad {
    animation: ek-entrar 0.28s ease both;
}

.ek-app > *:nth-child(2)  { animation-delay: 0.02s; }
.ek-app > *:nth-child(3)  { animation-delay: 0.05s; }
.ek-app > *:nth-child(4)  { animation-delay: 0.08s; }
.ek-app > *:nth-child(5)  { animation-delay: 0.11s; }
.ek-app > *:nth-child(6)  { animation-delay: 0.13s; }
.ek-app > *:nth-child(7)  { animation-delay: 0.15s; }

.ek-map-unidad:nth-child(2) { animation-delay: 0.05s; }
.ek-map-unidad:nth-child(3) { animation-delay: 0.09s; }
.ek-map-unidad:nth-child(4) { animation-delay: 0.12s; }

/* --- Pantallas de login, registro y bienvenida --- */
.ek-pantalla > * { animation: ek-entrar 0.3s ease both; }
.ek-pantalla > *:nth-child(2) { animation-delay: 0.04s; }
.ek-pantalla > *:nth-child(3) { animation-delay: 0.07s; }
.ek-pantalla > *:nth-child(4) { animation-delay: 0.1s; }

/* --- Opciones de la lección --- */
.ek-lec-opcion {
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.ek-lec-ok { animation: ek-pop 0.3s ease; }
.ek-lec-mal { animation: ek-temblar 0.32s ease; }

.ek-lec-feedback { animation: ek-entrar 0.22s ease both; }

/* La palabra cambia con un fundido al pasar de pregunta */
.ek-lec-palabra { animation: ek-aparecer 0.25s ease; }

/* --- Fichas del ejercicio de ordenar --- */
.ek-ficha {
    transition: opacity 0.15s ease, transform 0.12s ease,
                border-color 0.15s ease, background 0.15s ease;
}

.ek-ficha-puesta { animation: ek-entrar 0.18s ease both; }

/* --- Nodos del mapa --- */
.ek-map-nodo {
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.ek-map-nodo-activo:active { transform: scale(0.94); }

/* Latido suave en la lección que toca hacer, para guiar la vista */
@keyframes ek-latir {
    0%, 100% { box-shadow: 0 0 0 4px #FBEDE9; }
    50%      { box-shadow: 0 0 0 8px #FBEDE9; }
}

.ek-map-nodo-activo { animation: ek-latir 2.4s ease-in-out infinite; }

/* --- Botones --- */
.ek-boton-primario,
.ek-boton-secundario,
.ek-boton-claro,
.ek-boton-peligro,
.ek-boton-instalar {
    transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

.ek-boton-primario:disabled { opacity: 0.55; }

/* --- Interruptores y opciones de idioma --- */
.ek-idioma-op { transition: border-color 0.18s ease, background 0.18s ease; }
.ek-hiz-filtro { transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.ek-hiz-item { transition: border-color 0.18s ease; }
.ek-hiz-nota { animation: ek-aparecer 0.2s ease; }

/* --- Logros conseguidos --- */
.ek-logro { transition: opacity 0.25s ease, border-color 0.25s ease, background 0.25s ease; }

/* --- Barras y anillos ya tienen su transición; se afinan aquí --- */
.ek-barra-relleno,
.ek-mcer-relleno,
.ek-dominio-parte {
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

#ek-anillo-progreso {
    transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Aviso de sin conexión --- */
.ek-offline { animation: ek-entrar 0.25s ease both; }

/* ==========================================================
   Si el usuario ha pedido menos movimiento en su dispositivo,
   se desactiva todo. Importante para quien se marea con las
   animaciones o simplemente las prefiere apagadas.
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Texto explicativo en las pantallas de recuperación */
.ek-rec-texto {
    font-size: 14px;
    color: var(--ek-gris-texto);
    line-height: 1.5;
    margin: 0 0 22px;
    text-align: center;
}

/* ==========================================================
   TEXTOS LEGALES Y GESTIÓN DE DATOS
   ========================================================== */

.ek-legal {
    background: var(--ek-blanco);
    border: 0.5px solid var(--ek-borde);
    border-radius: 18px;
    padding: 22px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #3A3A36;
}

.ek-legal-fecha {
    font-size: 12px;
    color: var(--ek-gris-claro);
    margin: 0 0 20px;
}

.ek-legal h2 {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 17px;
    margin: 24px 0 8px;
    color: #232320;
}

.ek-legal h2:first-of-type { margin-top: 0; }

.ek-legal p { margin: 0 0 12px; }

.ek-legal ul {
    margin: 0 0 14px;
    padding-left: 20px;
}

.ek-legal li { margin-bottom: 7px; }

.ek-legal a { color: var(--ek-gorria); }

/* --- Casilla de consentimiento en el registro --- */
.ek-acepto {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 4px 0 18px;
    cursor: pointer;
}

.ek-acepto input {
    width: 21px;
    height: 21px;
    margin: 1px 0 0;
    accent-color: var(--ek-gorria);
    flex-shrink: 0;
}

.ek-acepto-eu {
    display: block;
    font-size: 13px;
    line-height: 1.4;
}

.ek-acepto-trad {
    display: block;
    font-size: 11px;
    color: var(--ek-gris-claro);
    margin-top: 1px;
}

.ek-acepto-enlace {
    display: inline-block;
    font-size: 12px;
    color: var(--ek-gorria);
    margin-top: 4px;
}

/* --- Enlace a privacidad desde el perfil --- */
.ek-enlace-privacidad {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #232320;
}

/* --- Zona de borrado de cuenta --- */
.ek-tarjeta-peligro {
    border: 0.5px solid #F0C4BC;
    background: #FEF8F7;
}

.ek-borrar-aviso {
    font-size: 13px;
    line-height: 1.5;
    color: #7A2618;
    background: #FBEDE9;
    border-radius: 10px;
    padding: 12px;
    margin: 0;
}

.ek-boton-borrar {
    background: var(--ek-gorria);
    color: #FFF3F2;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-family: var(--font-cuerpo);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.ek-boton-borrar:active { transform: scale(0.98); }

/* Instrucciones de instalación en iPhone */
.ek-pasos-ios {
    margin: 14px 0 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.55;
    color: #2C4A0A;
}

.ek-pasos-ios li { margin-bottom: 7px; }
.ek-pasos-ios li:last-child { margin-bottom: 0; }

/* ==========================================================
   GUARDADO AL TERMINAR LA LECCIÓN
   ========================================================== */

.ek-guardando {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ek-gris-texto);
    margin-top: 18px;
}

.ek-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid var(--ek-borde);
    border-top-color: var(--ek-berdea);
    border-radius: 50%;
    animation: ek-girar 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes ek-girar {
    to { transform: rotate(360deg); }
}

/* El botón aparece con un fundido suave cuando ya está guardado */
.ek-btn-oculto {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0 !important;
    overflow: hidden;
}

#ek-btn-fin {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    .ek-spinner { animation-duration: 1.4s; }
}

/* ==========================================================
   PUNTOS
   ========================================================== */

/* Badge en la cabecera de la home */
.ek-puntos-badge {
    background: #FBEDE9;
    color: #7A2618;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-titulos);
    padding: 5px 11px;
    border-radius: 20px;
}

/* Caja al terminar la lección */
.ek-puntos-caja {
    background: #F0F6E6;
    border: 1px solid var(--ek-berdea);
    border-radius: 16px;
    padding: 18px;
    margin: 18px 0 0;
    animation: ek-entrar 0.35s ease both;
}

.ek-puntos-num {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 38px;
    color: var(--ek-berdea);
    margin: 0;
    letter-spacing: -1px;
}

.ek-puntos-lab {
    font-size: 12px;
    color: #3E5A1B;
    margin: 0 0 12px;
}

.ek-puntos-desglose {
    border-top: 1px solid #D6E5BF;
    padding-top: 12px;
    text-align: left;
}

.ek-puntos-linea {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #3E5A1B;
    margin-bottom: 6px;
}

.ek-puntos-linea:last-child { margin-bottom: 0; }

.ek-puntos-linea-num {
    font-weight: 600;
    font-family: var(--font-titulos);
}

/* Tarjeta grande en estadísticas */
.ek-puntos-tarjeta {
    text-align: center;
    background: var(--ek-gorria);
    border: none;
    color: #FFF3F2;
    margin-top: 10px;
}

.ek-puntos-grande {
    font-family: var(--font-titulos);
    font-weight: 600;
    font-size: 44px;
    margin: 0;
    letter-spacing: -1.5px;
}

.ek-puntos-lab-grande {
    font-size: 14px;
    margin: 2px 0 0;
    opacity: 0.9;
}

.ek-puntos-tarjeta .ek-trad { color: #FBD5D0; }

/* Cuatro datos en el perfil en vez de tres */
.ek-perfil-datos-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ek-perfil-datos-4 .ek-perfil-num { font-size: 19px; }
.ek-perfil-datos-4 .ek-perfil-lab { font-size: 11px; }
.ek-perfil-datos-4 .ek-trad { font-size: 9px; }