/* ============================================================================
   styles.css — Vaughan English Suite · paleta pastel (v3)
   Dashboard profesional, colores pastel, animaciones de feedback.
   ========================================================================== */
:root {
  --ink: #2B2A3A; --ink-2: #4A4960; --muted: #7C7B90;
  --line: #ECEBF3; --line-2: #F3F2F9;
  --canvas: #F6F6FB; --surface: #FFFFFF; --surface-2: #FAFAFE;

  /* Marca: periwinkle (nada de verde) */
  --brand: #6B74E0; --brand-deep: #4E56C9; --brand-700: #3E45B0;
  --brand-soft: #E9EAFB; --brand-soft-2: #DADCF7;

  --amber: #E9A23B; --amber-soft: #FBEAD0;
  --coral: #E8657A; --coral-soft: #FBE4E9;
  --sky: #4AA6D8; --violet: #8B78E0;
  --ok: #2F9E77; --ok-soft: #DDF3EA;
  --no: #E05A57; --no-soft: #FCE4E3;

  --beg-soft: #FBE4EE; --int-soft: #E3F0FB; --adv-soft: #EDE7FB;

  --sh-sm: 0 1px 2px rgba(43,42,58,.05), 0 1px 3px rgba(43,42,58,.05);
  --sh: 0 6px 20px rgba(43,42,58,.07), 0 1px 3px rgba(43,42,58,.05);
  --sh-lg: 0 20px 48px rgba(43,42,58,.12);
  --sh-brand: 0 12px 30px rgba(107,116,224,.30);

  --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --accent: var(--brand); --accent-soft: var(--brand-soft);

  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --sidebar-w: 264px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--canvas); line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1,h2,h3,h4,.ui { font-family: var(--font-ui); letter-spacing: -.02em; line-height: 1.15; }
.num { font-family: var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

/* ================= App shell ================= */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; }
.brand .mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, var(--brand), var(--brand-deep)); box-shadow: var(--sh-brand); }
.brand .mark svg { width: 26px; height: 26px; }
.brand .bt b { font-family: var(--font-ui); font-weight: 800; font-size: 1.08rem; display: block; }
.brand .bt span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; background: none; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 600; font-size: .95rem; text-align: left; width: 100%; transition: background .15s, color .15s; }
.nav-item .ic { display: inline-flex; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.nav-item .tag { margin-left: auto; font-size: .58rem; font-weight: 800; letter-spacing: .05em; background: var(--coral); color: #fff; padding: 2px 7px; border-radius: 999px; }
.side-spacer { flex: 1; }
.tip-card { background: linear-gradient(160deg, var(--brand-soft), var(--surface)); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 8px 4px; }
.tip-card .th { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .82rem; color: var(--brand-deep); font-family: var(--font-ui); }
.tip-card .th svg { width: 18px; height: 18px; }
.tip-card p { font-size: .8rem; color: var(--ink-2); margin-top: 6px; }
.user-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line); }
.user-card .av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, var(--brand), var(--brand-deep)); color: #fff; display: grid; place-items: center; font-family: var(--font-ui); font-weight: 800; flex: 0 0 auto; }
.user-card .ui-b { min-width: 0; flex: 1; }
.user-card .ui-b b { font-family: var(--font-ui); font-size: .9rem; display: block; }
.user-card .ui-b span { font-size: .74rem; color: var(--muted); }
.user-card .lvl { font-size: .66rem; font-weight: 800; color: var(--brand-deep); background: var(--brand-soft); padding: 3px 8px; border-radius: 999px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(246,246,251,.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 14px 30px; display: flex; align-items: center; gap: 16px; }
.search { flex: 1; max-width: 560px; position: relative; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }
.search input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 11px 16px 11px 44px; font-size: .92rem; color: var(--ink); font-family: var(--font-body); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.top-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); border: 2px solid var(--surface); }
.goal { display: flex; align-items: center; gap: 12px; padding-left: 14px; border-left: 1px solid var(--line); }
.goal .gt { text-align: right; }
.goal .gt small { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.goal .gt b { font-family: var(--font-ui); font-size: .92rem; color: var(--brand-deep); }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--brand) calc(var(--p)*1%), var(--brand-soft-2) 0); }
.ring::before { content: ""; position: absolute; inset: 4px; background: var(--surface); border-radius: 50%; }
.ring b { position: relative; font-family: var(--font-ui); font-size: .66rem; font-weight: 800; color: var(--brand-deep); }

.content { padding: 26px 30px 60px; flex: 1; }
.view { display: none; }
.view.active { display: block; animation: viewIn .4s cubic-bezier(.22,.9,.3,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= Dashboard ================= */
.page-h { margin-bottom: 20px; }
.page-h h1 { font-size: 1.65rem; font-weight: 800; }
.page-h p { color: var(--muted); font-size: .95rem; margin-top: 3px; }
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 34px 36px; color: #fff; background: linear-gradient(135deg, #6E77E4 0%, #9A82E0 55%, #E79CC0 100%); box-shadow: var(--sh-brand); margin-bottom: 22px; }
.hero * { position: relative; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }
.hero .badge-ai { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); padding: 6px 13px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.hero .badge-ai svg { width: 15px; height: 15px; }
.hero h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; margin: 16px 0 10px; text-shadow: 0 2px 12px rgba(60,50,120,.28); }
.hero p { max-width: 540px; color: #fff; font-size: 1rem; text-shadow: 0 1px 8px rgba(60,50,120,.25); }
.hero p u { text-decoration-color: rgba(255,255,255,.7); text-underline-offset: 3px; font-weight: 700; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero .cta { background: #fff; color: var(--brand-deep); border: 0; border-radius: 14px; padding: 15px 24px; font-family: var(--font-ui); font-weight: 800; font-size: 1rem; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 10px 24px rgba(50,40,110,.22); transition: transform .12s, box-shadow .12s; white-space: nowrap; }
.hero .cta svg { width: 20px; height: 20px; }
.hero .cta:hover { transform: translateY(-2px); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-sm); transition: transform .15s, box-shadow .15s; }
.metric:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.metric .mh { display: flex; align-items: center; justify-content: space-between; }
.metric .mh span { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.metric .mh .mi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.metric .mh .mi svg { width: 19px; height: 19px; }
.metric .val { font-family: var(--font-ui); font-weight: 800; font-size: 2.1rem; margin: 12px 0 4px; }
.metric .val small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.metric .cap { font-size: .82rem; color: var(--muted); }
.metric .trend { font-size: .8rem; font-weight: 700; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; }
.metric .trend svg { width: 14px; height: 14px; }
.mi.i1 { background: var(--brand-soft); color: var(--brand-deep); }
.mi.i2 { background: var(--amber-soft); color: #B87A22; }
.mi.i3 { background: var(--int-soft); color: var(--sky); }
.mi.i4 { background: var(--coral-soft); color: #C0455C; }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-h h3 { font-size: 1.15rem; font-weight: 800; }
.section-h a, .section-h button { color: var(--brand-deep); font-weight: 700; font-size: .88rem; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; }
.section-h a svg, .section-h button svg { width: 16px; height: 16px; }

.lv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lv-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-sm); transition: transform .15s, box-shadow .15s; }
.lv-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.lv-top { display: flex; align-items: center; gap: 13px; }
.lv-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex: 0 0 auto; }
.lv-ic svg { width: 32px; height: 32px; }
.lv-name { font-family: var(--font-ui); font-weight: 800; font-size: 1.2rem; }
.lv-theme { font-size: .84rem; color: var(--muted); font-weight: 600; }
.lv-blurb { font-size: .86rem; color: var(--ink-2); margin: 14px 0 16px; min-height: 42px; }
.lv-bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.lv-bar i { display: block; height: 100%; border-radius: 999px; width: 0; transition: width .7s cubic-bezier(.2,.9,.3,1); }
.lv-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.lv-cta { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-weight: 800; font-size: .9rem; margin-top: 14px; }
.lv-cta svg { width: 17px; height: 17px; transition: transform .15s; }
.lv-card:hover .lv-cta svg { transform: translateX(4px); }

.module { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--sh-sm); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.module .m-body { flex: 1; min-width: 220px; }
.module .m-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-deep); }
.module h3 { font-size: 1.25rem; font-weight: 800; margin: 4px 0; }
.module p { color: var(--muted); font-size: .9rem; }
.module .m-prog { margin-top: 14px; }
.module .m-prog .bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.module .m-prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); border-radius: 999px; }

/* ================= Botones ================= */
.btn { font-family: var(--font-ui); font-weight: 700; font-size: .95rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 13px; padding: 12px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: transform .1s, box-shadow .12s, background .12s, border-color .12s; }
.btn svg { width: 19px; height: 19px; }
.btn:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(140deg, var(--brand), var(--brand-deep)); color: #fff; border: 0; box-shadow: var(--sh-brand); }
.btn.primary:hover { color: #fff; transform: translateY(-2px); }
.btn.big { padding: 15px 26px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ================= Nivel detalle ================= */
.level-hero { border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh); margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); }
.level-hero .lh-band { padding: 26px 28px; color: #fff; display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #3a3550)); }
.level-hero .lh-ic { width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); display: grid; place-items: center; flex: 0 0 auto; }
.level-hero .lh-ic svg { width: 36px; height: 36px; }
.level-hero .lh-band h2 { font-size: 1.7rem; font-weight: 800; text-shadow: 0 2px 10px rgba(40,30,80,.25); }
.level-hero .lh-band p { color: rgba(255,255,255,.92); }
.back-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.back-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 9px 15px; font-weight: 700; font-family: var(--font-ui); font-size: .88rem; color: var(--ink-2); }
.back-btn svg { width: 18px; height: 18px; }
.back-btn:hover { border-color: var(--brand); color: var(--brand-deep); }
.video-block { padding: 22px 28px 8px; }
.video-block .vb-h { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; font-family: var(--font-ui); font-weight: 800; }
.video-block .vb-h svg { width: 22px; height: 22px; color: var(--accent); }
.video-frame { position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; background: #14121c; border: 1px solid var(--line); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-cap { color: var(--muted); font-size: .85rem; padding: 12px 28px 22px; }
.entrega-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-weight: 800; font-size: .95rem; color: var(--brand-deep); margin: 22px 0 10px; }
.entrega-h svg { width: 18px; height: 18px; }
.entrega-h:first-of-type { margin-top: 4px; }
.units { display: grid; gap: 12px; }
.unit { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 18px; box-shadow: var(--sh-sm); transition: transform .12s, box-shadow .12s, border-color .12s; }
.unit:hover { transform: translateX(4px); box-shadow: var(--sh); border-color: var(--accent); }
.unit .u-n { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; font-family: var(--font-ui); font-weight: 800; font-size: 1.15rem; }
.unit .u-info { flex: 1; min-width: 0; }
.unit .u-info b { font-family: var(--font-ui); font-size: 1.02rem; font-weight: 700; }
.unit .u-info span { display: block; color: var(--muted); font-size: .85rem; }
.unit .u-st { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.unit .u-st .done { width: 28px; height: 28px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.unit .u-st .done svg { width: 17px; height: 17px; }
.unit .u-st .chev svg { width: 20px; height: 20px; }

/* ================= Lección / ejercicios ================= */
.lesson-wrap { max-width: 720px; margin: 0 auto; }
.lesson-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.lesson-bar .quit { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }
.lesson-bar .quit svg { width: 20px; height: 20px; }
.seg-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.seg-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #3a3550)); width: 0; transition: width .45s cubic-bezier(.2,.9,.3,1); }
.lesson-bar .hearts { display: flex; align-items: center; gap: 5px; color: var(--coral); font-weight: 800; font-family: var(--font-ui); }
.lesson-bar .hearts svg { width: 20px; height: 20px; }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh); padding: 30px; }
.card.flash-ok { animation: flashOk .6s; } .card.flash-no { animation: flashNo .5s; }
@keyframes flashOk { 0%,100%{box-shadow:var(--sh)} 30%{box-shadow:0 0 0 4px var(--ok-soft), var(--sh)} }
@keyframes flashNo { 0%,100%{box-shadow:var(--sh)} 30%{box-shadow:0 0 0 4px var(--no-soft), var(--sh)} }
.step-in { animation: stepIn .34s cubic-bezier(.22,.9,.3,1); }
@keyframes stepIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.step-out { animation: stepOut .2s ease forwards; }
@keyframes stepOut { to { opacity: 0; transform: translateX(-20px); } }

/* Overlay de feedback animado */
.fx { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 6; }
.fx .fx-badge { width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 12px 30px rgba(43,42,58,.25); }
.fx .fx-badge svg { width: 66px; height: 66px; }
.fx.ok .fx-badge { background: var(--ok); animation: fxPop .55s cubic-bezier(.2,.9,.3,1.5); }
.fx.no .fx-badge { background: var(--no); animation: fxShake .5s; }
.fx.fade { animation: fxFade .3s ease forwards; }
@keyframes fxPop { 0% { transform: scale(0) rotate(-25deg); opacity: 0; } 55% { transform: scale(1.18) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes fxShake { 0%,100%{transform:translateX(0)} 15%{transform:translateX(-12px) rotate(-6deg)} 30%{transform:translateX(10px) rotate(5deg)} 45%{transform:translateX(-8px)} 60%{transform:translateX(6px)} 75%{transform:translateX(-3px)} }
@keyframes fxFade { to { opacity: 0; } }

.ex-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--brand-deep); font-family: var(--font-ui); font-weight: 800; font-size: .8rem; padding: 6px 13px; border-radius: 999px; }
.ex-eyebrow svg { width: 16px; height: 16px; }
.intro h2 { font-size: 1.7rem; font-weight: 800; margin: 14px 0 3px; }
.intro .isub { color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.intro .rich p { margin: 10px 0; color: var(--ink-2); }
.intro .rich b { color: var(--brand-deep); font-weight: 700; }
.intro .rich .ojo, .intro .rich .negro, .intro .rich .pron, .intro .rich .olvides { display: inline-block; font-family: var(--font-ui); font-weight: 800; font-size: .82em; border-radius: 6px; padding: 1px 7px; color: #fff; margin-right: 3px; }
.intro .rich .ojo { background: var(--coral); } .intro .rich .negro { background: var(--ink); } .intro .rich .pron { background: var(--sky); } .intro .rich .olvides { background: var(--brand); }
.phrases { display: grid; gap: 10px; margin: 18px 0; }
.phrase { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; transition: border-color .15s; }
.phrase:hover { border-color: var(--brand); }
.phrase .p-txt { flex: 1; min-width: 0; }
.phrase .p-en { font-family: var(--font-ui); font-weight: 700; font-size: 1.06rem; }
.phrase .p-es { color: var(--muted); font-size: .86rem; }
.speak { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--brand-deep); display: grid; place-items: center; flex: 0 0 auto; transition: transform .1s, background .12s, color .12s; }
.speak svg { width: 22px; height: 22px; }
.speak:hover { background: var(--brand-soft); }
.speak:active { transform: scale(.92); }
.speak.playing { background: var(--brand); color: #fff; animation: sPulse .8s infinite; }
@keyframes sPulse { 50% { box-shadow: 0 0 0 6px var(--brand-soft); } }

.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.q-kind { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-title { font-family: var(--font-ui); font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; line-height: 1.2; }
.q-hint { color: var(--muted); font-weight: 500; margin-bottom: 20px; }
.q-hint b, .q-hint .es { color: var(--coral); font-weight: 700; }
.q-visual { display: grid; place-items: center; margin: 4px 0 22px; }
.q-visual .vbox { width: 138px; height: 138px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.q-visual .vbox > div { width: 96px; height: 96px; }
.audio-pill { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px; }
.opts { display: grid; gap: 12px; }
.opts.grid2 { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; color: var(--ink); box-shadow: 0 2px 0 var(--line); transition: transform .1s, border-color .12s, background .12s, box-shadow .1s; }
.opt:hover { border-color: var(--brand); background: var(--surface-2); }
.opt:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.opt .o-ic { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; }
.opt .o-ic svg { width: 36px; height: 36px; }
.opt .o-key { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: var(--muted); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 2px 0 var(--ok); animation: popOk .34s cubic-bezier(.2,.9,.3,1.3); }
.opt.correct .o-key { border-color: var(--ok); background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--no); background: var(--no-soft); box-shadow: 0 2px 0 var(--no); animation: shake .4s; }
.opt.wrong .o-key { border-color: var(--no); background: var(--no); color: #fff; }
.opt.dim { opacity: .45; }
@keyframes popOk { 30% { transform: scale(1.03); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(3px)} }
.field { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; font-family: var(--font-ui); font-weight: 600; font-size: 1.15rem; color: var(--ink); background: var(--surface); box-shadow: 0 2px 0 var(--line); }
.field::placeholder { color: var(--muted); font-weight: 500; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.prompt-box { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--coral); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.prompt-box .pb-t { flex: 1; }
.prompt-box .pb-es { color: var(--coral); font-family: var(--font-ui); font-weight: 800; font-size: 1.1rem; }
.prompt-box .pb-en { font-family: var(--font-ui); font-weight: 700; font-size: 1.06rem; }
.build-ans { min-height: 66px; border: 2px dashed var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 9px; align-content: flex-start; background: var(--surface-2); }
.build-ans.filled { border-color: var(--brand); }
.build-bank { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { font-family: var(--font-ui); font-weight: 700; font-size: 1rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 15px; box-shadow: 0 2px 0 var(--line); transition: transform .1s; animation: chipIn .2s ease; }
@keyframes chipIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.chip:hover { border-color: var(--brand); }
.chip:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.chip.used { visibility: hidden; }
.action-row { margin-top: 22px; }
.feedback { border-radius: var(--r-lg); padding: 20px 22px; margin-top: 20px; animation: fbUp .3s cubic-bezier(.2,.9,.3,1.1); }
@keyframes fbUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.feedback.ok { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, #fff); }
.feedback.no { background: var(--no-soft); border: 1px solid color-mix(in srgb, var(--no) 30%, #fff); }
.fb-head { display: flex; align-items: center; gap: 12px; font-family: var(--font-ui); font-weight: 800; font-size: 1.25rem; }
.fb-head .fi { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.fb-head .fi svg { width: 24px; height: 24px; }
.feedback.ok .fi { background: var(--ok); } .feedback.no .fi { background: var(--no); }
.feedback.ok .fb-head { color: var(--brand-700); } .feedback.no .fb-head { color: #B23A28; }
.fb-why { margin: 10px 0 12px; color: var(--ink-2); font-size: .95rem; }
.fb-why b { color: var(--brand-deep); }
.fb-correct { font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-correct em { font-style: normal; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font-family: var(--font-ui); }
.fb-correct .speak { width: 36px; height: 36px; }

/* ================= Gimnasia verbal ================= */
.drill-pick { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.drill-level { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-sm); transition: transform .15s, box-shadow .15s; }
.drill-level:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.drill-level .dl-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 12px; }
.drill-level .dl-ic svg { width: 26px; height: 26px; }
.drill-level h4 { font-family: var(--font-ui); font-size: 1.1rem; font-weight: 800; }
.drill-level p { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.drill-set-list { display: grid; gap: 11px; }
.drill-set { display: flex; align-items: center; gap: 15px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-sm); transition: transform .12s, border-color .12s; }
.drill-set:hover { transform: translateX(4px); border-color: var(--accent); }
.drill-set .ds-n { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-ui); font-weight: 800; flex: 0 0 auto; }
.drill-set .ds-b { flex: 1; }
.drill-set .ds-b b { font-family: var(--font-ui); font-weight: 700; }
.drill-set .ds-b span { display: block; color: var(--muted); font-size: .82rem; }
.drill-set .ds-c svg { width: 20px; height: 20px; color: var(--muted); }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 4px; }
.mode-card { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--sh-sm); transition: transform .12s, border-color .12s; }
.mode-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.mode-card .mc-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.mode-card .mc-ic svg { width: 22px; height: 22px; }
.mode-card b { font-family: var(--font-ui); font-size: 1.05rem; display: block; }
.mode-card span { color: var(--muted); font-size: .84rem; }
.drill-stage { max-width: 700px; margin: 0 auto; }
.drill-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh); padding: 34px 30px; text-align: center; }
.drill-card .dc-count { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drill-card .dc-es { font-family: var(--font-ui); font-size: 1.7rem; font-weight: 800; margin: 14px 0 6px; line-height: 1.25; }
.drill-card .dc-en { font-family: var(--font-ui); font-size: 1.5rem; font-weight: 800; color: var(--brand-deep); margin: 22px 0 6px; animation: revealEn .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes revealEn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.drill-card .dc-en.hidden-en { color: var(--line); filter: blur(9px); user-select: none; animation: none; }
.drill-card .dc-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ================= Vocabulario (tarjetas robustas, sin 3D) ================= */
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.vcard { position: relative; height: 176px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); overflow: hidden; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--sh); border-color: var(--brand); }
.vcard .vface { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px; transition: opacity .28s, transform .28s; }
.vcard .vfront .vic { width: 74px; height: 74px; }
.vcard .vfront .ven { font-family: var(--font-ui); font-weight: 700; font-size: .98rem; }
.vcard .vfront .hintflip { position: absolute; top: 10px; right: 12px; font-size: .68rem; color: var(--muted); font-weight: 700; }
.vcard .vback { opacity: 0; transform: scale(.96); pointer-events: none; background: linear-gradient(155deg, var(--brand-soft), var(--surface)); }
.vcard.show .vfront { opacity: 0; transform: scale(1.04); }
.vcard.show .vback { opacity: 1; transform: none; pointer-events: auto; }
.vcard .vback .ben { font-family: var(--font-ui); font-weight: 800; font-size: 1.16rem; color: var(--brand-deep); }
.vcard .vback .bes { color: var(--ink-2); font-size: .92rem; }
.vcard .vback .speak { margin-top: 6px; }

/* ================= Progreso ================= */
.prog-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-sm); }
.panel h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; }
.lvl-prog { display: grid; gap: 16px; }
.lvl-prog .lp-top { display: flex; justify-content: space-between; margin-bottom: 7px; font-weight: 700; font-family: var(--font-ui); font-size: .92rem; }
.lvl-prog .lp-top span { color: var(--muted); font-weight: 600; }
.lvl-prog .lp-bar { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.lvl-prog .lp-bar i { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.2,.9,.3,1); }
.big-stats { display: grid; gap: 14px; }
.big-stat { display: flex; align-items: center; gap: 15px; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.big-stat .bi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.big-stat .bi svg { width: 24px; height: 24px; }
.big-stat b { font-family: var(--font-ui); font-size: 1.5rem; font-weight: 800; }
.big-stat span { color: var(--muted); font-size: .85rem; }

.result { text-align: center; padding: 24px 8px; }
.result .r-medal { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); animation: fxPop .55s cubic-bezier(.2,.9,.3,1.4); }
.result .r-medal svg { width: 54px; height: 54px; }
.result h2 { font-size: 2rem; font-weight: 800; }
.result .r-sub { color: var(--muted); margin-top: 4px; }
.result .r-stats { display: flex; justify-content: center; gap: 14px; margin: 24px 0; flex-wrap: wrap; }
.result .r-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 24px; min-width: 100px; }
.result .r-stat b { display: block; font-family: var(--font-ui); font-size: 1.9rem; font-weight: 800; color: var(--brand-deep); }
.result .r-stat span { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

.bottom-nav { display: none; }

/* ================= Responsive ================= */
@media (max-width: 1080px) { .metrics { grid-template-columns: repeat(2, 1fr); } .lv-grid, .drill-pick { grid-template-columns: 1fr; } .prog-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; } .sidebar { display: none; }
  .topbar { padding: 12px 16px; } .content { padding: 18px 16px 96px; }
  .hero { padding: 24px 20px; } .hero-row { flex-direction: column; align-items: stretch; } .hero .cta { width: 100%; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: .66rem; font-weight: 700; padding: 4px 8px; border-radius: 10px; flex: 1; }
  .bn-item svg { width: 23px; height: 23px; }
  .bn-item.active { color: var(--brand-deep); }
  .opts.grid2 { grid-template-columns: 1fr; }
  .card, .drill-card { padding: 22px 18px; } .q-title { font-size: 1.3rem; } .drill-card .dc-es { font-size: 1.4rem; }
  .mode-row { grid-template-columns: 1fr; }
  .search { max-width: none; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; } .metric { padding: 15px; } .metric .val { font-size: 1.6rem; }
  .goal .gt { display: none; } .vocab-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
