/* ═══════════════════════════════════════════════════════════════════════
   CHINOESFERA — hoja de estilos principal
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --red-900: #6d0f0f;
    --red-700: #a51919;
    --red-600: #c41e1e;
    --red-500: #e02b2b;
    --red-050: #fdf1f0;
    --gold-500: #e8a93c;
    --gold-300: #f5c96e;
    --ink-900: #17121c;
    --ink-700: #2c2433;
    --ink-500: #5c5364;
    --paper: #faf6f1;
    --white: #ffffff;
    --ok: #1e8a4c;
    --ko: #c62838;

    --font-ui: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    --font-hanzi: 'Noto Serif SC', 'Segoe UI', serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 26px;
    --shadow-sm: 0 2px 10px rgba(23, 18, 28, .07);
    --shadow-md: 0 10px 30px rgba(23, 18, 28, .12);
    --shadow-lg: 0 24px 60px rgba(23, 18, 28, .18);
    --ease: cubic-bezier(.22, .9, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* El menú móvil fuera de pantalla no debe crear scroll horizontal */
html, body { overflow-x: clip; }

/* El atributo hidden gana siempre, aunque el elemento tenga display propio */
[hidden] { display: none !important; }

body {
    font-family: var(--font-ui);
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(196, 30, 30, .06), transparent 60%),
        radial-gradient(900px 420px at -10% 30%, rgba(232, 169, 60, .08), transparent 55%),
        var(--paper);
    color: var(--ink-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ── Cabecera ─────────────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem clamp(1rem, 4vw, 2.5rem);
    background: transparent;
    border-bottom: 1px solid rgba(23, 18, 28, .07);
}

/*
 * El fondo de cristal va en un pseudo-elemento, NO en .site-header:
 * backdrop-filter en el propio header lo convertiría en el bloque
 * contenedor de sus descendientes position:fixed (el cajón del menú
 * móvil), que entonces se dimensionaría contra el header en vez de
 * contra la ventana. Con el blur aislado aquí, el cajón vuelve a
 * anclarse a la ventana.
 */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.brand-logo { height: 52px; display: block; }

.site-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}

.site-nav a {
    padding: .5rem .85rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink-700);
    transition: background .2s var(--ease), color .2s var(--ease);
    white-space: nowrap;
}

.site-nav a:hover { background: var(--red-050); color: var(--red-600); }

.site-nav a.active {
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(196, 30, 30, .35);
}

.nav-icon { margin-right: .35rem; }

.nav-toggle { display: none; }
.nav-burger { display: none; }

/* ── Contenedor de página ─────────────────────────────────────────────── */

.page {
    width: min(1060px, 94%);
    margin: 0 auto;
    padding: clamp(1.2rem, 3vw, 2.4rem) 0 3rem;
    flex: 1;
}

.section-title {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink-900);
    text-align: center;
    margin-bottom: 1.4rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    margin: .55rem auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--red-600), var(--gold-500));
}

.panel {
    background: var(--white);
    border: 1px solid rgba(23, 18, 28, .06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(1.4rem, 3.5vw, 2.6rem);
    animation: rise .45s var(--ease) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.text-center { text-align: center; }
.empty-state { text-align: center; color: var(--ink-500); padding: 2rem 0; }
.hint-note { text-align: center; color: var(--ink-500); font-size: .85rem; margin-top: 1.2rem; }

/* ── Botones ──────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1.25rem;
    border: 1.5px solid rgba(23, 18, 28, .12);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink-900);
    font-weight: 600;
    font-size: .95rem;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.btn-primary {
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 6px 18px rgba(196, 30, 30, .35);
}

.btn-primary:hover { box-shadow: 0 10px 26px rgba(196, 30, 30, .45); }

.btn-accent {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
    border-color: transparent;
    color: var(--ink-900);
}

.btn-ghost { background: transparent; }

.btn-lg { padding: .85rem 1.7rem; font-size: 1.05rem; }

.link-audio {
    background: none;
    border: none;
    font-size: 1.05rem;
    padding: .15rem .3rem;
    border-radius: 8px;
    transition: transform .15s var(--ease);
}

.link-audio:hover { transform: scale(1.25); }

/* ── HERO (portada) ───────────────────────────────────────────────────── */

.hero2 {
    position: relative;
    overflow: clip;
    border-radius: var(--radius-lg);
    margin-bottom: 2.4rem;
    color: var(--white);
    background: linear-gradient(160deg, #120c16 0%, #221019 55%, #3a1114 100%);
    box-shadow: var(--shadow-lg);
    isolation: isolate;
}

.mesh {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    z-index: -1;
    animation: mesh-float 14s ease-in-out infinite alternate;
}

.mesh-a { width: 480px; height: 480px; top: -180px; left: -120px; background: radial-gradient(circle, #e02b2b, transparent 65%); }
.mesh-b { width: 420px; height: 420px; bottom: -160px; right: 8%; background: radial-gradient(circle, #e8a93c, transparent 65%); animation-delay: -5s; }
.mesh-c { width: 300px; height: 300px; top: 20%; right: -110px; background: radial-gradient(circle, #7c2ae8, transparent 65%); opacity: .3; animation-delay: -9s; }

@keyframes mesh-float {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(50px, 35px) scale(1.15); }
}

.hero2-seal {
    position: absolute;
    top: 1.6rem;
    right: 2rem;
    writing-mode: vertical-rl;
    font-family: 'Ma Shan Zheng', var(--font-hanzi);
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1;
    color: rgba(255, 255, 255, .1);
    border: 2px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: .8rem .3rem;
    user-select: none;
    pointer-events: none;
}

.hero2-grid {
    display: grid;
    grid-template-columns: 1.25fr .85fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    padding: clamp(2.2rem, 6vw, 4.2rem) clamp(1.4rem, 5vw, 3.6rem) clamp(1.6rem, 4vw, 2.6rem);
}

.hero2-kicker {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .38rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(8px);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: rgba(255, 255, 255, .85);
    margin-bottom: 1.3rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-500);
    box-shadow: 0 0 0 0 rgba(232, 169, 60, .7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70%  { box-shadow: 0 0 0 9px rgba(232, 169, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 169, 60, 0); }
}

.hero2-title {
    font-size: clamp(2.3rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -.03em;
    margin-bottom: 1.1rem;
}

.hero2-title em {
    font-style: normal;
    background: linear-gradient(92deg, #ff8f6b 0%, var(--gold-300) 50%, #ffe9bd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero2-sub {
    font-size: clamp(1rem, 1.9vw, 1.14rem);
    font-weight: 300;
    color: rgba(255, 255, 255, .72);
    max-width: 50ch;
    margin-bottom: 1.7rem;
}

.hero2-cta {
    display: flex;
    gap: .9rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2.1rem;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .9rem 1.7rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red-600), #ff5a3c);
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(224, 43, 43, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.btn-hero:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 40px rgba(224, 43, 43, .55); }

.btn-hero-icon {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    font-size: .72rem;
}

.btn-hero-ghost {
    padding: .9rem 1.4rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .9);
    font-weight: 600;
    transition: all .2s var(--ease);
}

.btn-hero-ghost:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }

.hero2-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.hero2-stats > div {
    padding: 0 clamp(1rem, 2.6vw, 1.8rem);
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.hero2-stats > div:first-child { padding-left: 0; border-left: none; }

.hero2-stats dt {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 900;
    line-height: 1.05;
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, .55));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero2-stats dd {
    color: rgba(255, 255, 255, .55);
    font-size: .78rem;
    letter-spacing: .09em;
    text-transform: uppercase;
}

/* Tarjeta de último episodio (cristal) */
.hero2-card {
    position: relative;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem 1.5rem 1.4rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.hero2-card-label {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-300);
    margin-bottom: .8rem;
}

.hero2-card-level {
    display: inline-block;
    font-size: .74rem;
    font-weight: 700;
    padding: .2rem .7rem;
    border-radius: 999px;
    background: rgba(224, 43, 43, .25);
    border: 1px solid rgba(224, 43, 43, .5);
    color: #ffb3a6;
    margin-bottom: .6rem;
}

.hero2-card-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: .6rem;
}

.hero2-card-desc {
    font-size: .9rem;
    font-weight: 300;
    color: rgba(255, 255, 255, .65);
    margin-bottom: 1.1rem;
}

.hero2-card-actions { display: flex; align-items: center; gap: 1rem; }

.hero2-card-meta { display: flex; flex-direction: column; gap: .15rem; font-size: .86rem; }
.hero2-card-meta b { color: rgba(255, 255, 255, .9); }
.hero2-card-meta a { color: var(--gold-300); font-weight: 600; }
.hero2-card-meta a:hover { text-decoration: underline; }

/* Cinta de vocabulario en movimiento */
.word-ticker {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .25);
    overflow: hidden;
    padding: .75rem 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.word-ticker-track {
    display: inline-flex;
    gap: 2.6rem;
    white-space: nowrap;
    animation: ticker 55s linear infinite;
    will-change: transform;
}

.word-ticker:hover .word-ticker-track { animation-play-state: paused; }

@keyframes ticker {
    to { transform: translateX(-50%); }
}

.ticker-item { display: inline-flex; align-items: baseline; gap: .55rem; }
.ticker-hanzi { font-family: var(--font-hanzi); font-size: 1.25rem; font-weight: 600; color: var(--gold-300); }
.ticker-pinyin { font-size: .88rem; color: rgba(255, 255, 255, .8); font-weight: 600; }
.ticker-meaning { font-size: .88rem; color: rgba(255, 255, 255, .45); }

/* ── BENTO (herramientas) ─────────────────────────────────────────────── */

.bento-section { margin-bottom: 2.6rem; }

.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: 1rem;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    background: var(--white);
    border: 1px solid rgba(23, 18, 28, .08);
    border-radius: 20px;
    padding: 1.35rem 1.3rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(196, 30, 30, .3);
}

.tile-tag {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.tile h3 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.tile p { font-size: .9rem; color: var(--ink-500); }

.tile-go {
    margin-top: auto;
    font-weight: 700;
    font-size: .9rem;
    color: var(--red-600);
}

.tile-go-btn { background: none; border: none; text-align: left; padding: 0; }
.tile-go-btn:hover { text-decoration: underline; }

/* Colocación en la rejilla */
.tile-flash    { grid-column: span 2; grid-row: span 2; }
.tile-wotd     { grid-column: span 2; grid-row: span 2; }
.tile-quiz     { grid-column: span 2; }
.tile-pron     { grid-column: span 2; }
.tile-podcasts { grid-column: span 4; grid-row: span 2; }
.tile-strokes  { grid-column: span 2; grid-row: span 2; }
.tile-vocab    { grid-column: span 2; }
.tile-forum    { grid-column: span 2; }
.tile-campus   { grid-column: span 2; }

/* Tile destacada: tarjetas */
.tile-flash {
    background:
        radial-gradient(320px 200px at 110% -10%, rgba(232, 169, 60, .4), transparent 60%),
        linear-gradient(150deg, var(--red-900), var(--red-600));
    border: none;
    color: var(--white);
}

.tile-flash .tile-tag { color: rgba(255, 255, 255, .75); }
.tile-flash p { color: rgba(255, 255, 255, .72); }
.tile-flash .tile-go { color: var(--gold-300); }

.tile-hanzi {
    position: absolute;
    right: -.4rem;
    bottom: -1.6rem;
    font-family: 'Ma Shan Zheng', var(--font-hanzi);
    font-size: 8.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, .13);
    pointer-events: none;
}

/* Palabra del día */
.tile-wotd {
    align-items: center;
    text-align: center;
    justify-content: center;
    background:
        radial-gradient(260px 160px at 50% -20%, rgba(232, 169, 60, .25), transparent 70%),
        var(--white);
}

.wotd-hanzi {
    background: none;
    border: none;
    font-family: var(--font-hanzi);
    font-size: 4.6rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--ink-900);
    transition: transform .2s var(--ease), color .2s;
}

.wotd-hanzi:hover { transform: scale(1.08); color: var(--red-600); }

.wotd-pinyin { font-size: 1.25rem; font-weight: 700; color: var(--red-600); }
.wotd-meaning { font-size: 1rem; color: var(--ink-500); }

/* Trazos */
.tile-strokes { align-items: center; text-align: center; }

.tile-gif {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    border: 1px solid rgba(23, 18, 28, .08);
    object-fit: cover;
    background: var(--white);
}

/* Vocabulario con buscador integrado */
.tile-search {
    margin-top: auto;
    display: flex;
    border: 1.5px solid rgba(23, 18, 28, .14);
    border-radius: 999px;
    overflow: hidden;
    background: var(--paper);
}

.tile-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: .55rem .95rem;
    font-size: .9rem;
}

.tile-search button {
    border: none;
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
    padding: 0 1rem;
}

/* Últimos episodios */
.mini-episodes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: .3rem 0 .7rem;
}

.mini-episodes li {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .55rem .7rem;
    border-radius: 14px;
    background: var(--paper);
    border: 1px solid rgba(23, 18, 28, .06);
    transition: background .18s, border-color .18s;
}

.mini-episodes li:hover { background: var(--red-050); border-color: rgba(196, 30, 30, .25); }

.mini-ep-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mini-ep-info b { font-size: .95rem; }
.mini-ep-info span { font-size: .78rem; color: var(--ink-500); }

.mini-ep-pdf {
    font-size: .78rem;
    font-weight: 700;
    padding: .25rem .7rem;
    border-radius: 999px;
    background: rgba(232, 169, 60, .16);
    border: 1px solid rgba(232, 169, 60, .5);
    color: #8a6210;
}

.mini-ep-pdf:hover { background: var(--gold-500); color: var(--white); }

/* Foro y campus */
.tile-forum, .tile-campus { justify-content: center; }

/* ── RUTA DE NIVELES ──────────────────────────────────────────────────── */

.journey { margin-bottom: 2.6rem; }

.journey-path {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .8rem;
    counter-reset: paso;
}

.journey-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    text-align: center;
    background: var(--white);
    border: 1px solid rgba(23, 18, 28, .08);
    border-radius: 18px;
    padding: 1.2rem .7rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
}

.journey-step:hover {
    transform: translateY(-5px);
    border-color: rgba(196, 30, 30, .35);
    box-shadow: var(--shadow-md);
}

.journey-num {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-600), #ff5a3c);
    color: var(--white);
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(224, 43, 43, .35);
    margin-bottom: .3rem;
}

.journey-step b { font-size: .98rem; }
.journey-step span:last-child { font-size: .78rem; color: var(--ink-500); }

/* ── BANDA CTA ────────────────────────────────────────────────────────── */

.cta-band {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.2rem);
    flex-wrap: wrap;
    background: linear-gradient(150deg, #17121c, #34131c);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 4vw, 2.4rem) clamp(1.4rem, 4vw, 2.8rem);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.cta-hanzi {
    font-family: 'Ma Shan Zheng', var(--font-hanzi);
    font-size: clamp(3rem, 7vw, 4.6rem);
    line-height: 1;
    background: linear-gradient(135deg, var(--gold-300), #ff8f6b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cta-band h2 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 800; }
.cta-band p { color: rgba(255, 255, 255, .65); font-size: .95rem; }
.cta-band .btn-hero { margin-left: auto; }

/* ── Flashcards ───────────────────────────────────────────────────────── */

.card-counter { text-align: center; color: var(--ink-500); margin-bottom: 1rem; }

.flip-toggle { position: absolute; opacity: 0; pointer-events: none; }

.flashcard {
    display: block;
    width: min(420px, 100%);
    height: 280px;
    margin: 0 auto;
    cursor: pointer;
    perspective: 1200px;
}

.flashcard-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s var(--ease);
}

.flip-toggle:checked + .flashcard .flashcard-inner { transform: rotateY(180deg); }

.flashcard-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    border-radius: var(--radius-md);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: var(--shadow-md);
}

.flashcard-front {
    background:
        radial-gradient(400px 200px at 80% -20%, rgba(232, 169, 60, .25), transparent 60%),
        linear-gradient(150deg, var(--red-700), var(--red-600));
    color: var(--white);
}

.flashcard-front .hanzi {
    font-family: var(--font-hanzi);
    font-size: 5.4rem;
    font-weight: 900;
    text-shadow: 0 6px 24px rgba(0, 0, 0, .3);
}

.flip-hint {
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.flashcard-back {
    background: var(--white);
    border: 1.5px solid rgba(196, 30, 30, .25);
    transform: rotateY(180deg);
}

.flashcard-back .pinyin {
    font-size: 2rem;
    font-weight: 700;
    color: var(--red-600);
}

.flashcard-back .meaning { font-size: 1.3rem; color: var(--ink-700); }

.card-controls {
    display: flex;
    justify-content: center;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

/* ── Quiz ─────────────────────────────────────────────────────────────── */

.quiz-mode { text-align: center; color: var(--ink-500); margin-bottom: .4rem; }

.quiz-hanzi {
    display: block;
    margin: 0 auto 1.4rem;
    background: none;
    border: none;
    font-family: var(--font-hanzi);
    font-size: clamp(3.4rem, 9vw, 5rem);
    font-weight: 900;
    color: var(--red-600);
    line-height: 1.15;
    transition: transform .2s var(--ease);
}

.quiz-hanzi:hover { transform: scale(1.07); }

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .8rem;
    max-width: 640px;
    margin: 0 auto 1.4rem;
}

.quiz-option {
    padding: .95rem 1rem;
    border: 2px solid rgba(196, 30, 30, .4);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--red-700);
    font-size: 1.05rem;
    font-weight: 600;
    transition: all .18s var(--ease);
}

.quiz-option:hover {
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    border-color: transparent;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(196, 30, 30, .3);
}

.feedback {
    max-width: 480px;
    margin: 0 auto 1.4rem;
    padding: .85rem 1.1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    animation: rise .3s var(--ease) both;
}

.feedback-ok { background: #e9f7ef; border: 2px solid var(--ok); color: var(--ok); }
.feedback-ko { background: #fdeef0; border: 2px solid var(--ko); color: var(--ko); }

.score-card {
    max-width: 340px;
    margin: 1.6rem auto;
    background: var(--paper);
    border: 1px solid rgba(23, 18, 28, .08);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.3rem;
}

.score-card h2 {
    font-size: 1rem;
    text-align: center;
    color: var(--red-600);
    margin-bottom: .6rem;
    letter-spacing: .02em;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: .3rem 0;
    border-bottom: 1px dashed rgba(23, 18, 28, .1);
    font-size: .95rem;
}

.score-item:last-child { border-bottom: none; }

/* ── Pronunciación ────────────────────────────────────────────────────── */

.pron-pinyin { text-align: center; font-size: 1.15rem; color: var(--ink-500); margin-bottom: 1rem; }

/* ── Trazos ───────────────────────────────────────────────────────────── */

.strokes-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.strokes-figure { text-align: center; }

.strokes-image {
    width: 240px;
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(23, 18, 28, .08);
    background: var(--white);
}

.strokes-figure figcaption { margin-top: .7rem; color: var(--ink-500); font-size: 1.05rem; }

.strokes-form {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    align-items: center;
}

.strokes-form label { font-weight: 600; color: var(--ink-700); }

.char-input {
    width: 110px;
    padding: .7rem;
    text-align: center;
    font-family: var(--font-hanzi);
    font-size: 2.2rem;
    border: 2px solid rgba(196, 30, 30, .4);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--white);
    transition: border-color .2s;
}

.char-input:focus { border-color: var(--gold-500); }

/* ── Vocabulario ──────────────────────────────────────────────────────── */

.search-bar {
    display: flex;
    max-width: 560px;
    margin: 0 auto 1.4rem;
    box-shadow: var(--shadow-sm);
    border-radius: 999px;
    overflow: hidden;
    border: 1.5px solid rgba(23, 18, 28, .1);
    background: var(--white);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: .8rem 1.2rem;
    font-size: 1rem;
    background: transparent;
}

.search-button {
    border: none;
    padding: 0 1.4rem;
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
    font-size: 1.05rem;
}

.search-summary { text-align: center; color: var(--ink-500); margin-bottom: 1rem; }
.search-summary a { color: var(--red-600); font-weight: 600; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

.vocab-table { width: 100%; border-collapse: collapse; background: var(--white); }

.vocab-table th {
    background: linear-gradient(135deg, var(--red-700), var(--red-600));
    color: var(--white);
    text-align: left;
    padding: .85rem 1.1rem;
    font-size: .92rem;
    letter-spacing: .03em;
}

.vocab-table td {
    padding: .7rem 1.1rem;
    border-bottom: 1px solid rgba(23, 18, 28, .06);
}

.vocab-table tr:hover td { background: var(--red-050); }

.vocab-hanzi { font-family: var(--font-hanzi); font-size: 1.35rem; font-weight: 600; }
.vocab-pinyin { color: var(--red-700); font-weight: 600; }
.vocab-audio { width: 3rem; text-align: center; }

/* ── Podcasts ─────────────────────────────────────────────────────────── */

.podcast-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.podcast-tab {
    padding: .5rem 1.1rem;
    border-radius: 999px;
    background: var(--paper);
    border: 1.5px solid rgba(23, 18, 28, .1);
    font-weight: 600;
    font-size: .92rem;
    transition: all .18s var(--ease);
}

.podcast-tab:hover { border-color: var(--red-600); color: var(--red-600); }

.podcast-tab.active {
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 4px 14px rgba(196, 30, 30, .3);
}

.podcast-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }

.podcast-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid rgba(23, 18, 28, .07);
    border-radius: var(--radius-md);
    padding: .8rem 1.1rem;
    box-shadow: var(--shadow-sm);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}

.podcast-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.podcast-item.playing { border-color: var(--red-600); background: var(--red-050); }

.podcast-play:not(.btn-hero) {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
    font-size: .95rem;
    box-shadow: 0 4px 14px rgba(196, 30, 30, .35);
    transition: transform .18s var(--ease);
}

.podcast-play:not(.btn-hero):hover { transform: scale(1.12); }

.podcast-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.podcast-title { font-weight: 700; }

.podcast-meta { font-size: .85rem; color: var(--ink-500); }

.podcast-pdf {
    flex-shrink: 0;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: rgba(232, 169, 60, .15);
    border: 1px solid rgba(232, 169, 60, .5);
    color: #8a6210;
    font-weight: 600;
    font-size: .85rem;
    transition: all .18s;
}

.podcast-pdf:hover { background: var(--gold-500); color: var(--white); }

.podcast-count { text-align: center; color: var(--ink-500); margin-top: 1.2rem; font-size: .9rem; }
.podcast-count a { color: var(--red-600); font-weight: 600; }

.podcast-play-sm { width: 36px; height: 36px; font-size: .8rem; }

.podcast-play-xl {
    width: 64px;
    height: 64px;
    font-size: 1.3rem;
    box-shadow: 0 10px 30px rgba(224, 43, 43, .5);
}

/* ── REPRODUCTOR GLOBAL ───────────────────────────────────────────────── */

.player-bar {
    position: fixed;
    left: 50%;
    bottom: 1.1rem;
    transform: translateX(-50%);
    z-index: 240;
    width: min(680px, calc(100vw - 2rem));
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .75rem 1rem;
    border-radius: 22px;
    background: rgba(20, 14, 24, .88);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--white);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
    animation: player-in .35s var(--ease) both;
}

@keyframes player-in {
    from { opacity: 0; transform: translate(-50%, 18px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.pb-toggle {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-600), #ff5a3c);
    color: var(--white);
    box-shadow: 0 8px 22px rgba(224, 43, 43, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .18s var(--ease);
}

.pb-toggle:hover { transform: scale(1.08); }

.pb-toggle svg { width: 22px; height: 22px; }

.pb-icon-pause { display: none; }
.player-bar.is-playing .pb-icon-play { display: none; }
.player-bar.is-playing .pb-icon-pause { display: block; }

.pb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }

.pb-top { display: flex; align-items: center; gap: .6rem; min-width: 0; }

.player-title {
    font-weight: 700;
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ecualizador animado mientras suena */
.pb-eq {
    flex-shrink: 0;
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.pb-eq i {
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-300), var(--red-500));
    height: 30%;
}

.player-bar.is-playing .pb-eq i { animation: eq .9s ease-in-out infinite alternate; }
.pb-eq i:nth-child(1) { animation-delay: 0s; }
.pb-eq i:nth-child(2) { animation-delay: .25s; }
.pb-eq i:nth-child(3) { animation-delay: .5s; }
.pb-eq i:nth-child(4) { animation-delay: .12s; }

@keyframes eq {
    from { height: 25%; }
    to   { height: 100%; }
}

.pb-seek { display: flex; align-items: center; gap: .6rem; }

.pb-time {
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .6);
    min-width: 2.6rem;
    text-align: center;
}

#pb-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .18);
    accent-color: var(--red-500);
    cursor: pointer;
    outline: none;
}

#pb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--red-500);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
    transition: transform .15s;
}

#pb-range::-webkit-slider-thumb:hover { transform: scale(1.25); }

#pb-range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--red-500);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.pb-speed {
    flex-shrink: 0;
    padding: .3rem .65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .85);
    font-size: .78rem;
    font-weight: 700;
    transition: background .15s;
}

.pb-speed:hover { background: rgba(255, 255, 255, .18); }

.pb-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .7);
    font-size: 1.05rem;
    line-height: 1;
    transition: background .15s, color .15s;
}

.pb-close:hover { background: rgba(255, 255, 255, .22); color: var(--white); }

/* ── Pie de página ────────────────────────────────────────────────────── */

.site-footer {
    background:
        radial-gradient(600px 200px at 90% 0%, rgba(196, 30, 30, .25), transparent 60%),
        var(--ink-900);
    color: rgba(255, 255, 255, .85);
    padding: 2.6rem 1.5rem 2rem;
    margin-top: 2rem;
}

.footer-inner {
    width: min(1060px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    text-align: center;
}

.footer-hanzi {
    font-family: var(--font-hanzi);
    font-size: 2rem;
    font-weight: 900;
    display: block;
    background: linear-gradient(90deg, var(--gold-300), var(--red-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: .3rem;
}

.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; }

.footer-links a {
    color: rgba(255, 255, 255, .7);
    font-size: .92rem;
    transition: color .18s;
}

.footer-links a:hover { color: var(--gold-300); }

.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--gold-500);
    color: var(--ink-900);
    font-weight: 700;
    padding: .55rem 1.2rem;
    border-radius: 999px;
    font-size: .92rem;
    transition: transform .18s var(--ease), box-shadow .18s;
}

.donate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(232, 169, 60, .4); }

.copyright { color: rgba(255, 255, 255, .45); font-size: .85rem; }

/* ── Banner de cookies ────────────────────────────────────────────────── */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: var(--white);
    border-top: 3px solid var(--red-600);
    box-shadow: 0 -8px 30px rgba(23, 18, 28, .18);
    padding: 1rem 1.4rem;
    animation: slide-up .45s var(--ease) both;
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.cookie-content {
    width: min(1000px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-text { font-size: .92rem; }

.cookie-buttons { display: flex; gap: .6rem; }

.btn-cookie {
    padding: .55rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    transition: all .18s;
}

.btn-accept {
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
    border: none;
}

.btn-accept:hover { box-shadow: 0 6px 18px rgba(196, 30, 30, .4); }

.btn-deny {
    background: transparent;
    border: 1.5px solid rgba(23, 18, 28, .2);
    color: var(--ink-500);
}

.btn-deny:hover { border-color: var(--ink-900); color: var(--ink-900); }

/* ── Chino Li (mascota + chat) ────────────────────────────────────────── */

.chinoli {
    position: fixed;
    right: 18px;
    bottom: 14px;
    z-index: 250;
    transition: bottom .3s var(--ease);
}

/* Con el reproductor abierto, la mascota sube para no taparlo */
body.has-player .chinoli { bottom: 96px; }
body.has-player .chinoli-dialog { bottom: 370px; }

.chinoli-avatar {
    display: block;
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    transition: transform .25s var(--ease);
}

.chinoli-avatar:hover { transform: scale(1.08) rotate(-2deg); }

.chinoli-avatar video {
    display: block;
    width: 260px;
    height: 260px;
    object-fit: contain;
    filter: drop-shadow(0 14px 24px rgba(23, 18, 28, .28));
}

.chinoli-dialog {
    position: fixed;
    right: 18px;
    bottom: 285px;
    width: min(340px, calc(100vw - 36px));
    background: var(--white);
    border-radius: var(--radius-md);
    border: 2px solid var(--red-600);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: rise .3s var(--ease) both;
}

.chinoli-header {
    background: linear-gradient(135deg, var(--red-700), var(--red-600));
    color: var(--white);
    font-weight: 700;
    font-size: .92rem;
    padding: .7rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chinoli-header button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 .2rem;
}

.chinoli-body {
    padding: .9rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-height: 300px;
    overflow-y: auto;
}

.chinoli-msg {
    max-width: 85%;
    padding: .6rem .85rem;
    border-radius: 14px;
    font-size: .9rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.chinoli-msg.bot {
    background: var(--paper);
    border: 1px solid rgba(23, 18, 28, .07);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chinoli-msg.bot a { color: var(--red-600); text-decoration: underline; }

.chinoli-msg.user {
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chinoli-msg.typing { color: var(--ink-500); font-style: italic; }

.chinoli-quick { display: flex; flex-wrap: wrap; gap: .4rem; }

.chinoli-quick button {
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(196, 30, 30, .35);
    background: var(--white);
    color: var(--red-700);
    font-size: .8rem;
    font-weight: 600;
    transition: all .15s;
}

.chinoli-quick button:hover { background: var(--red-600); border-color: var(--red-600); color: var(--white); }

.chinoli-input-area {
    display: flex;
    gap: .5rem;
    padding: .7rem;
    border-top: 1px solid rgba(23, 18, 28, .08);
}

.chinoli-input-area input {
    flex: 1;
    padding: .55rem .9rem;
    border: 1.5px solid rgba(23, 18, 28, .15);
    border-radius: 999px;
    outline: none;
    font-size: .9rem;
}

.chinoli-input-area input:focus { border-color: var(--red-600); }

.chinoli-input-area button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-600), var(--red-500));
    color: var(--white);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 920px) {
    .nav-burger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        border-radius: var(--radius-sm);
        background: linear-gradient(135deg, var(--red-600), var(--red-500));
        cursor: pointer;
        flex-shrink: 0;
    }

    .nav-burger span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--white);
        border-radius: 2px;
        transition: transform .25s var(--ease), opacity .2s;
    }

    .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .site-nav {
        position: fixed;
        top: 68px;
        right: 0;
        bottom: 0;
        width: min(280px, 80vw);
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        padding: 1.2rem .9rem;
        transform: translateX(105%);
        transition: transform .3s var(--ease);
        overflow-y: auto;
    }

    .nav-toggle:checked ~ .site-nav { transform: translateX(0); }

    .site-nav a { border-radius: var(--radius-sm); padding: .8rem 1rem; }

    .quiz-options { grid-template-columns: 1fr; }

    .chinoli-avatar video { width: 160px; height: 160px; }
    .chinoli-dialog { bottom: 185px; }

    /* Hero y bento en una columna */
    .hero2-grid { grid-template-columns: 1fr; }
    .hero2-seal { display: none; }

    .bento { grid-template-columns: 1fr 1fr; }
    .tile-flash, .tile-wotd, .tile-quiz, .tile-pron,
    .tile-strokes, .tile-vocab { grid-column: span 2; grid-row: auto; }
    .tile-podcasts { grid-column: span 2; grid-row: auto; }
    .tile-forum, .tile-campus { grid-column: span 1; }

    .journey-path { grid-template-columns: repeat(2, 1fr); }

    .cta-band { justify-content: center; text-align: center; }
    .cta-band .btn-hero { margin-left: 0; }

    .player-bar { bottom: .6rem; gap: .6rem; padding: .6rem .7rem; }
    .pb-speed { display: none; }
}

@media (min-width: 921px) and (max-width: 1100px) {
    .journey-path { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
