/* ==========================================================================
   Carnet B · Comunitat Valenciana — sistema visual
   Paleta cálida: crema, terracota (naranja valenciana), azul tinta, salvia.
   ========================================================================== */
:root {
  --bg: #f5f1ea; --bg-2: #ede6db;
  --surface: #fffdf9; --surface-2: #f5f0e8; --surface-3: #ebe3d6;
  --text: #1d1b18; --text-2: #5a544b; --muted: #8f877b;
  --border: #e5ddd0; --border-2: #d6cbba;
  --ink: #1f3a5f; --ink-2: #2e5384; --ink-soft: #e2e8f0;
  --primary: #d4532a; --primary-2: #e8774f; --primary-soft: #fae4d9; --on-primary: #fff;
  --ok: #2c8a5c; --ok-soft: #dff0e5; --bad: #c03a31; --bad-soft: #f7e0dc;
  --warn: #c4860f; --warn-soft: #f7ebd0; --tip: #4f63a8; --tip-soft: #e6e9f5;
  --gold: #d9a326;
  --road: #3a3d44; --road-line: #f1e9d8;
  --shadow-sm: 0 1px 2px rgba(45,35,20,.06);
  --shadow: 0 1px 2px rgba(45,35,20,.05), 0 6px 20px -6px rgba(45,35,20,.12);
  --shadow-lg: 0 24px 60px -18px rgba(45,35,20,.28);
  --radius: 20px; --radius-sm: 13px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --sky1: #f6d9bf; --sky2: #f7efe3; --sun: #ee9a6e; --hill1: #d9cdb2; --hill2: #b9c59f; --hill3: #a7b98f; --tree: #6f8d5c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315; --bg-2: #15181b; --surface: #191c20; --surface-2: #20242a; --surface-3: #282d34;
    --text: #f2eee8; --text-2: #bdb5a9; --muted: #857d72; --border: #2b3036; --border-2: #3a4048;
    --ink: #9fbbe0; --ink-2: #b9cfee; --ink-soft: #1c2735;
    --primary: #ee7448; --primary-2: #f5936e; --primary-soft: #3a2219;
    --ok: #5cc08d; --ok-soft: #163024; --bad: #ef6b61; --bad-soft: #3a1b1a; --warn: #e6b04c; --warn-soft: #33290f; --tip: #9aabea; --tip-soft: #1f2542;
    --road: #2a2d33; --road-line: #d9d1c0;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.7);
    --sky1: #1a2236; --sky2: #2b2a33; --sun: #e9c48a; --hill1: #2a3330; --hill2: #24302a; --hill3: #1f2925; --tree: #34503c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111315; --bg-2: #15181b; --surface: #191c20; --surface-2: #20242a; --surface-3: #282d34;
  --text: #f2eee8; --text-2: #bdb5a9; --muted: #857d72; --border: #2b3036; --border-2: #3a4048;
  --ink: #9fbbe0; --ink-2: #b9cfee; --ink-soft: #1c2735;
  --primary: #ee7448; --primary-2: #f5936e; --primary-soft: #3a2219;
  --ok: #5cc08d; --ok-soft: #163024; --bad: #ef6b61; --bad-soft: #3a1b1a; --warn: #e6b04c; --warn-soft: #33290f; --tip: #9aabea; --tip-soft: #1f2542;
  --road: #2a2d33; --road-line: #d9d1c0;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.7);
  --sky1: #1a2236; --sky2: #2b2a33; --sun: #e9c48a; --hill1: #2a3330; --hill2: #24302a; --hill3: #1f2925; --tree: #34503c;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--ink-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0 0 .45em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; color: inherit; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--primary-soft); }
main { min-height: calc(100vh - 140px); outline: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--display); font-weight: 800; font-size: 1.15rem; position: relative; overflow: hidden; }
.brand-logo::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 6px; height: 3px; border-radius: 3px; background: var(--primary-2); }
.brand-text { font-family: var(--display); font-weight: 700; line-height: 1.05; font-size: 1.05rem; }
.brand-text small { display: block; font-family: var(--font); font-size: .68rem; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); padding: 8px 12px; border-radius: 11px; font-weight: 600; font-size: .9rem; text-decoration: none; transition: background .2s, color .2s; position: relative; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.nav a.active .ic { color: var(--primary); }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; }
.badge[hidden] { display: none; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; transition: transform .25s var(--spring), color .2s; }
.icon-btn:hover { transform: rotate(-10deg); color: var(--text); }
.streak-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .85rem; color: var(--text); text-decoration: none !important; }
.streak-chip .goal-ring { width: 30px; height: 30px; }
.streak-chip .fl { color: var(--primary); display: inline-flex; }
.streak-chip.off .fl { color: var(--muted); }
.streak-chip.bump { animation: pop .6s var(--spring); }

/* Barra inferior móvil */
.tabbar { display: none; }
@media (max-width: 900px) {
  .nav { display: none; }
  .topbar-actions { margin-left: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; font-size: .68rem; font-weight: 600; color: var(--muted); text-decoration: none !important; transition: color .2s; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a.active .ic { animation: pop .45s var(--spring); }
  body { padding-bottom: 72px; }
  .brand-text small { display: none; }
}

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 650; font-size: .96rem; text-decoration: none !important; transition: transform .18s var(--ease), box-shadow .2s, background .2s, color .2s; user-select: none; line-height: 1.2; position: relative; overflow: hidden; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 18px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 90%, #000); transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .btn-ink { color: #111; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 11px; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; border-radius: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ic { transition: transform .25s var(--ease); }
.btn:hover .ic-move { transform: translateX(3px); }
.btn::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,.35), transparent 40%); opacity: 0; transition: opacity .4s; }
.btn.rippling::after { opacity: 1; transition: none; }
.pulse-ring { animation: ring 2s var(--ease) infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Cards / grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card-flat { background: var(--surface-2); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none !important; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; position: relative; overflow: hidden; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-2); }
.tile .t-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--ink)) 12%, transparent); color: var(--c, var(--ink)); margin-bottom: 4px; transition: transform .35s var(--spring); }
.tile:hover .t-ic { transform: rotate(-8deg) scale(1.08); }
.tile p { color: var(--text-2); margin: 0; font-size: .93rem; }
.tile .go { position: absolute; right: 18px; top: 20px; color: var(--muted); transition: transform .3s var(--ease), color .3s; }
.tile:hover .go { transform: translateX(4px); color: var(--primary); }

/* ---------- Hero ilustrado ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 1140px; margin: 0 auto; padding: 56px 16px 28px; display: grid; gap: 28px; grid-template-columns: 1.05fr .95fr; align-items: center; position: relative; z-index: 2; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; padding-top: 34px; } }
.hero h1 em { font-style: normal; color: var(--primary); position: relative; white-space: nowrap; }
.hero h1 em svg { position: absolute; left: 0; bottom: -.12em; width: 100%; height: .3em; overflow: visible; }
.hero h1 em path { stroke: var(--primary); stroke-width: 4; fill: none; stroke-linecap: round; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 1.2s .5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.lead { font-size: 1.12rem; color: var(--text-2); max-width: 540px; }
.hero-scene { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 5 / 4; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.hero-scene svg { width: 100%; height: 100%; display: block; }
.par-1 { animation: slide 60s linear infinite; } .par-2 { animation: slide 28s linear infinite; } .par-3 { animation: slide 9s linear infinite; }
@keyframes slide { to { transform: translateX(-500px); } }
.dash-move { animation: dash .6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -60; } }
.wheel { animation: spin .5s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.bounce { animation: carBounce .9s ease-in-out infinite; }
@keyframes carBounce { 50% { transform: translateY(-1.2px); } }
.tl-r { animation: tlr 6s infinite; } .tl-a { animation: tla 6s infinite; } .tl-v { animation: tlv 6s infinite; }
@keyframes tlr { 0%,40% { fill: #e5483b; } 41%,100% { fill: #4a4d55; } }
@keyframes tla { 0%,40% { fill: #4a4d55; } 41%,52% { fill: #f2b425; } 53%,100% { fill: #4a4d55; } }
@keyframes tlv { 0%,52% { fill: #4a4d55; } 53%,100% { fill: #34a56a; } }
.sun-glow { animation: glow 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes glow { 50% { transform: scale(1.05); opacity: .85; } }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--text); }
.hero-stats div span { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ---------- Panel "Hoy" ---------- */
.today { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; margin-top: -4px; }
@media (max-width: 900px) { .today { grid-template-columns: 1fr; } }
.goal-card { display: flex; gap: 18px; align-items: center; }
.goal-ring { width: 96px; height: 96px; flex: none; }
.goal-ring circle { fill: none; }
.goal-ring .bg { stroke: var(--surface-3); }
.goal-ring .fg { stroke: var(--primary); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1.2s var(--ease); }
.goal-ring.done .fg { stroke: var(--ok); }
.goal-ring text { font-family: var(--display); font-weight: 800; fill: var(--text); }
.streak-big { display: flex; align-items: center; gap: 14px; }
.flame-wrap { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.flame-wrap.off { background: var(--surface-2); color: var(--muted); }
.flame-wrap svg { animation: flicker 1.8s ease-in-out infinite; transform-origin: bottom center; }
.flame-wrap.off svg { animation: none; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 25% { transform: scale(1.06, .96) rotate(2deg); } 50% { transform: scale(.97, 1.05) rotate(-1deg); } 75% { transform: scale(1.04) rotate(1deg); } }
.week { display: flex; gap: 6px; margin-top: 12px; }
.week .d { flex: 1; text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); }
.week .d i { display: block; height: 26px; border-radius: 8px; background: var(--surface-2); margin-bottom: 4px; transition: background .3s; position: relative; }
.week .d.on i { background: var(--primary); }
.week .d.frz i { background: var(--tip-soft); box-shadow: inset 0 0 0 2px var(--tip); }
.week .d.today i { box-shadow: inset 0 0 0 2px var(--primary); }
.week .d.on.today i { box-shadow: none; }
.missions { display: grid; gap: 8px; }
.mission { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 13px; background: var(--surface-2); font-size: .9rem; font-weight: 550; }
.mission .mc { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border-2); display: grid; place-items: center; flex: none; color: #fff; transition: all .3s var(--spring); }
.mission.done .mc { background: var(--ok); border-color: var(--ok); transform: rotate(-8deg); }
.mission.done span { color: var(--muted); text-decoration: line-through; }
.mission small { margin-left: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Ruta ---------- */
.units { display: grid; gap: 18px; }
.unit { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.unit-head { display: flex; gap: 16px; align-items: center; padding: 18px 20px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 70%); cursor: pointer; }
.unit-head .u-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.unit-head h3 { margin: 0; }
.unit-head p { margin: 2px 0 0; color: var(--text-2); font-size: .9rem; }
.unit-meter { min-width: 120px; text-align: right; font-size: .8rem; color: var(--muted); font-weight: 600; }
.unit-meter .bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.unit-meter .bar i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 99px; transition: width 1.1s var(--ease); }
.path { position: relative; padding: 10px 20px 26px; display: grid; gap: 4px; }
.node { --c2: var(--c); display: flex; align-items: center; gap: 16px; padding: 8px 10px; border-radius: 16px; text-decoration: none !important; color: var(--text); position: relative; transition: background .2s; }
.node:hover { background: var(--surface-2); }
.node .dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); border: 2.5px solid var(--border-2); color: var(--muted); position: relative; z-index: 1; transition: transform .3s var(--spring); }
.node:hover .dot { transform: scale(1.08); }
.node.done .dot { background: var(--c2); border-color: var(--c2); color: #fff; }
.node.next .dot { border-color: var(--c2); color: var(--c2); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c2) 18%, transparent); animation: nodePulse 2s var(--ease) infinite; }
@keyframes nodePulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--c2) 6%, transparent); } }
.node::before { content: ""; position: absolute; left: 32px; top: -6px; height: 14px; width: 2.5px; background: var(--border-2); }
.node:first-child::before { display: none; }
.node.done::before { background: var(--c2); }
.node .nt { flex: 1; min-width: 0; }
.node .nt b { display: block; font-weight: 600; font-size: .96rem; }
.node .nt small { color: var(--muted); font-size: .8rem; }
.node .tag-next { font-size: .72rem; font-weight: 700; color: #fff; background: var(--c2); padding: 3px 9px; border-radius: 99px; }
.stars { display: inline-flex; gap: 2px; color: var(--surface-3); }
.stars .on { color: var(--gold); }
.stars .ic { fill: currentColor; stroke: none; }

/* ---------- Lecciones ---------- */
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.lesson { font-size: 1.04rem; }
.lesson ul { padding-left: 0; list-style: none; margin: 0 0 1.2em; }
.lesson ul li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.lesson ul li::before { content: ""; position: absolute; left: 6px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--primary)); transform: rotate(45deg); }
.lesson > .rv { opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.lesson > .rv.in { opacity: 1; transform: none; }
.box { border-radius: 16px; padding: 16px 18px 16px 56px; margin: 0 0 1.2em; position: relative; border: 1px solid transparent; }
.box .bx-ic { position: absolute; left: 16px; top: 15px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.box b.tag { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; }
.box-clave { background: var(--ink-soft); border-color: color-mix(in srgb, var(--ink) 18%, transparent); } .box-clave .bx-ic { background: var(--ink); color: #fff; } .box-clave b.tag { color: var(--ink); }
.box-truco { background: var(--tip-soft); border-color: color-mix(in srgb, var(--tip) 22%, transparent); } .box-truco .bx-ic { background: var(--tip); color: #fff; } .box-truco b.tag { color: var(--tip); }
.box-aviso { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, transparent); } .box-aviso .bx-ic { background: var(--warn); color: #fff; } .box-aviso b.tag { color: var(--warn); }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border-radius: 16px; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; background: var(--surface); }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 700; font-size: .82rem; color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
.sign-block { display: flex; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; margin: 0 0 1.2em; }
.sign-block svg { flex: none; width: 78px; height: 78px; transition: transform .5s var(--spring); filter: drop-shadow(0 4px 8px rgba(0,0,0,.12)); }
.sign-block:hover svg { transform: scale(1.1) rotate(-5deg); }
.sign-block h4 { margin: 0 0 4px; font-family: var(--font); font-weight: 700; }
.sign-block p { margin: 0; color: var(--text-2); font-size: .95rem; }
.lesson-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.lesson-nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.reading-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--primary); z-index: 70; width: 0; }
.speaking { outline: 2.5px solid var(--primary-2); outline-offset: 5px; border-radius: 10px; }
.resumen { position: relative; overflow: hidden; border-radius: 22px; padding: 22px 24px; margin: 0 0 28px; background: var(--c, var(--ink)); color: #fff; }
.resumen::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.resumen::after { content: ""; position: absolute; right: 40px; bottom: -80px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.06); }
.resumen .rs-tag { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .85; display: flex; gap: 6px; align-items: center; }
.resumen .rs-idea { font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin: 8px 0 14px; line-height: 1.3; position: relative; }
.resumen ol { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; position: relative; }
.resumen ol li { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.12); padding: 9px 12px; border-radius: 12px; animation: slideIn .6s var(--ease) both; }
.resumen ol li:nth-child(2) { animation-delay: .1s; } .resumen ol li:nth-child(3) { animation-delay: .2s; }
.resumen ol li b.n { flex: none; width: 24px; height: 24px; border-radius: 8px; background: #fff; color: var(--c, var(--ink)); display: grid; place-items: center; font-size: .78rem; }
.resumen .rs-rec { opacity: .92; margin: 0; position: relative; display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.sim-launch { display: flex; gap: 18px; align-items: center; padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px dashed var(--border-2); margin: 26px 0 0; color: var(--text); text-decoration: none !important; transition: border-color .3s, transform .3s var(--ease); }
.sim-launch:hover { border-color: var(--primary); transform: translateY(-2px); }
.sim-launch .t-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }

/* ---------- Preguntas ---------- */
.q-card { padding: 26px; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .85rem; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.q-tema { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 600; }
.q-text { font-family: var(--display); font-size: 1.28rem; font-weight: 650; margin-bottom: 18px; line-height: 1.35; letter-spacing: -.01em; }
.q-sign { display: flex; justify-content: center; margin: 0 0 18px; }
.q-sign svg { width: 118px; height: 118px; animation: signIn .6s var(--spring); filter: drop-shadow(0 6px 12px rgba(0,0,0,.14)); }
@keyframes signIn { from { transform: scale(.5) rotate(-14deg); opacity: 0; } }
.options { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; border-radius: 15px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 500; transition: border-color .2s, background .25s, transform .2s var(--ease); position: relative; overflow: hidden; }
.opt:hover:not([disabled]) { border-color: var(--border-2); background: var(--surface-2); transform: translateX(3px); }
.opt .letter { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: .9rem; transition: all .3s var(--spring); }
.opt .mark { margin-left: auto; flex: none; opacity: 0; }
.opt.selected { border-color: var(--ink); background: var(--ink-soft); }
.opt.selected .letter { background: var(--ink); color: #fff; }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .letter { background: var(--ok); color: #fff; transform: scale(1.08); }
.opt.correct .mark { opacity: 1; color: var(--ok); }
.opt.correct .mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .1s var(--ease) forwards; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake .45s; }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt.wrong .mark { opacity: 1; color: var(--bad); }
.opt[disabled] { cursor: default; }
.opt.dim { opacity: .55; }
@keyframes shake { 15%,55% { transform: translateX(-6px); } 35%,75% { transform: translateX(6px); } }
.explain { margin-top: 16px; padding: 14px 16px 14px 18px; border-radius: 15px; background: var(--surface-2); border-left: 4px solid var(--ok); animation: rise .45s var(--ease) both; }
.explain.bad { border-left-color: var(--bad); }
.explain b { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-progress { display: flex; gap: 4px; margin-bottom: 18px; }
.q-progress i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); transition: background .35s, transform .35s var(--spring); }
.q-progress i.ok { background: var(--ok); } .q-progress i.ko { background: var(--bad); } .q-progress i.cur { background: var(--ink); transform: scaleY(1.4); }
.combo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--primary); font-size: .9rem; }
.combo.pop { animation: pop .5s var(--spring); }
.mini-quiz { margin: 0 0 1.4em; }
.mini-quiz .card { border-style: dashed; border-width: 1.5px; }

.exam-bar { position: sticky; top: 59px; z-index: 20; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.25rem; display: flex; gap: 8px; align-items: center; font-family: var(--display); }
.timer.low { color: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .5; } }
.exam-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 18px; }
@media (max-width: 520px) { .exam-grid { grid-template-columns: repeat(6, 1fr); } }
.exam-grid button { aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; color: var(--text-2); font-size: .82rem; transition: all .2s; }
.exam-grid button.answered { background: var(--ink-soft); border-color: var(--ink); color: var(--ink); }
.exam-grid button.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.exam-grid button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.exam-grid button.ko { background: var(--bad); border-color: var(--bad); color: #fff; }
.result-hero { text-align: center; padding: 40px 22px; }
.verdict { font-family: var(--display); font-size: 2.6rem; font-weight: 800; letter-spacing: .02em; animation: pop .7s var(--spring); }
.verdict.ok { color: var(--ok); } .verdict.ko { color: var(--bad); }
.ring { width: 160px; height: 160px; margin: 10px auto 16px; display: block; }
.ring circle { fill: none; stroke-width: 12; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1.4s var(--ease); }
.ring text { font-family: var(--display); font-weight: 800; font-size: 32px; fill: var(--text); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .88rem; transition: all .2s; }
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
:root[data-theme="dark"] .chip.on { color: #111; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on, :root:not([data-theme="light"]) .btn-ink { color: #111; } }
.field-label { font-weight: 700; margin: 20px 0 10px; display: block; font-size: .92rem; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 13px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 8px 14px; font-weight: 600; font-size: .88rem; border-radius: 10px; transition: all .25s var(--ease); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* ---------- Señales ---------- */
.sign-card { perspective: 900px; cursor: pointer; }
.flip { position: relative; height: 230px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.25,.8,.25,1); }
.sign-card.flipped .flip { transform: rotateY(180deg); }
.flip > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 10px; }
.flip .back { transform: rotateY(180deg); text-align: left; justify-content: flex-start; overflow: auto; font-size: .9rem; color: var(--text-2); background: var(--surface-2); }
.flip .back h4 { color: var(--text); margin: 0; font-size: 1rem; font-family: var(--font); }
.flip svg { width: 108px; height: 108px; transition: transform .4s var(--spring); filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.sign-card:hover .front svg { transform: scale(1.07) rotate(-3deg); }
.flip .front .nm { font-weight: 700; font-size: .85rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Tarjetas ---------- */
.fc-stage { position: relative; max-width: 540px; margin: 0 auto; height: 330px; perspective: 1400px; }
.fc { position: absolute; inset: 0; cursor: pointer; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.25,.8,.25,1); }
.fc.flipped { transform: rotateY(180deg); }
.fc.out-left { transition: transform .45s ease-in, opacity .45s; transform: translateX(-130%) rotate(-18deg); opacity: 0; }
.fc.out-right { transition: transform .45s ease-in, opacity .45s; transform: translateX(130%) rotate(18deg); opacity: 0; }
.fc.enter { animation: cardIn .55s var(--spring); }
@keyframes cardIn { from { transform: translateY(30px) scale(.92); opacity: 0; } }
.fc > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; box-shadow: var(--shadow-lg); }
.fc .ff { background: var(--c, var(--ink)); color: #fff; }
.fc .ff::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; pointer-events: none; }
.fc .fb { background: var(--surface); border: 1.5px solid var(--border); transform: rotateY(180deg); }
.fc .f-ic { width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.15); display: grid; place-items: center; margin-bottom: 14px; }
.fc .ft { font-family: var(--display); font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
.fc .fd { font-family: var(--display); font-size: 1.45rem; font-weight: 650; }
.fc .fn { margin-top: 12px; color: var(--text-2); font-size: .92rem; }
.fc-hint { position: absolute; bottom: 20px; font-size: .76rem; opacity: .7; display: flex; gap: 6px; align-items: center; }
.fc-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.fc-actions .btn { min-width: 160px; }
.btn-bad { background: var(--bad-soft); color: var(--bad); }
.btn-good { background: var(--ok-soft); color: var(--ok); }

/* ---------- Preparación ---------- */
.ready { display: grid; grid-template-columns: 280px 1fr; gap: 26px; align-items: center; }
@media (max-width: 760px) { .ready { grid-template-columns: 1fr; } }
.gauge { width: 100%; max-width: 280px; margin: 0 auto; display: block; }
.gauge .arc-bg { stroke: var(--surface-3); }
.gauge .arc { transition: stroke-dashoffset 1.6s var(--ease); }
.gauge text { font-family: var(--display); fill: var(--text); }
.ten { display: flex; gap: 6px; margin: 14px 0 6px; flex-wrap: wrap; }
.ten span { width: 30px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); animation: pop .5s var(--spring) both; }
.ten span.ok { background: var(--ok-soft); color: var(--ok); }
.mastery { display: grid; gap: 14px; }
.m-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; }
.m-row .m-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.m-row .m-t { font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; gap: 8px; }
.m-row .m-t small { color: var(--muted); font-weight: 600; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin-top: 6px; }
.stack i { display: block; height: 100%; width: 0; transition: width 1.2s var(--ease); }
.stack .s-dom { background: var(--ok); } .stack .s-apr { background: var(--warn); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); }
.heat i.l1 { background: color-mix(in srgb, var(--primary) 30%, var(--surface-3)); } .heat i.l2 { background: color-mix(in srgb, var(--primary) 55%, var(--surface-3)); }
.heat i.l3 { background: color-mix(in srgb, var(--primary) 80%, var(--surface-3)); } .heat i.l4 { background: var(--primary); }
.heat i.fz { box-shadow: inset 0 0 0 2px var(--tip); }
.spark { width: 100%; height: 150px; display: block; }
.spark .line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.6s var(--ease) forwards; }
.spark .pass { stroke: var(--ok); stroke-dasharray: 5 5; stroke-width: 1.5; }
.spark circle.ok { fill: var(--ok); } .spark circle.ko { fill: var(--bad); }
.spark text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.weak { display: grid; gap: 10px; }
.weak a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none !important; transition: transform .25s var(--ease); }
.weak a:hover { transform: translateX(4px); }
.weak a b { font-weight: 600; font-size: .92rem; flex: 1; }
.weak a small { color: var(--bad); font-weight: 700; }
.logros { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.logro { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.logro .le { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.logro.on .le { background: var(--gold); color: #fff; }
.logro b { display: block; font-size: .9rem; } .logro small { color: var(--muted); font-size: .78rem; }
.logro:not(.on) b { color: var(--text-2); }
.logro .lp { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.logro .lp i { display: block; height: 100%; background: var(--gold); }

/* ---------- Simuladores ---------- */
.sim-shell { display: grid; gap: 18px; }
.steps-bar { display: flex; gap: 8px; background: var(--surface-2); padding: 5px; border-radius: 16px; }
.steps-bar button { flex: 1; border: 0; background: transparent; padding: 10px 8px; border-radius: 12px; font-weight: 650; font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .3s var(--ease); }
.steps-bar button .sn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: var(--surface-3); color: var(--text-2); transition: all .3s var(--spring); }
.steps-bar button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.steps-bar button.on .sn { background: var(--primary); color: #fff; }
.steps-bar button.done .sn { background: var(--ok); color: #fff; }
@media (max-width: 560px) { .steps-bar button .lb { display: none; } }
.learn-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.learn-card { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); animation: rise .6s var(--ease) both; }
.learn-card:nth-child(2) { animation-delay: .1s; } .learn-card:nth-child(3) { animation-delay: .2s; }
.learn-card .ln { width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font-family: var(--display); font-weight: 800; display: grid; place-items: center; margin-bottom: 10px; }
.sim-play { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 920px) { .sim-play { grid-template-columns: 1fr; } }
.stage { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 16px; overflow: hidden; }
.stage-svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 14px; }
.ctrl { display: flex; flex-direction: column; gap: 6px; min-width: 200px; flex: 1; }
.ctrl-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--text-2); }
.ctrl-label b { font-family: var(--display); font-size: 1.1rem; color: var(--text); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--primary) var(--p, 50%), var(--surface-3) var(--p, 50%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: var(--shadow); cursor: grab; transition: transform .2s var(--spring); }
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.2); cursor: grabbing; }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); cursor: grab; }
.side { display: grid; gap: 14px; }
.mission-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.mission-box h4 { margin: 0 0 10px; display: flex; gap: 8px; align-items: center; font-family: var(--font); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; font-size: .92rem; border-top: 1px solid var(--border); }
.task:first-of-type { border-top: 0; }
.task .tc { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-2); flex: none; display: grid; place-items: center; color: #fff; margin-top: 1px; transition: all .35s var(--spring); }
.task.done .tc { background: var(--ok); border-color: var(--ok); transform: scale(1.1) rotate(-6deg); }
.task.done span { color: var(--muted); }
.task.just { animation: taskFlash 1s var(--ease); }
@keyframes taskFlash { 0% { background: var(--ok-soft); } 100% { background: transparent; } }
.narr { background: var(--ink); color: #fff; border-radius: 20px; padding: 16px 18px; font-size: .95rem; min-height: 90px; position: relative; }
.narr .nl { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; opacity: .7; font-weight: 700; display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.narr .nb { animation: rise .4s var(--ease); }
.narr.ok { background: var(--ok); } .narr.ko { background: var(--bad); }
:root[data-theme="dark"] .narr:not(.ok):not(.ko) { color: #111; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .narr:not(.ok):not(.ko) { color: #111; } }
.readout { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.readout span { padding: 7px 12px; border-radius: 11px; background: var(--surface-2); font-size: .88rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.readout .sw { width: 10px; height: 10px; border-radius: 3px; }
.stage.shake { animation: shake .45s; }
.sim-tile .t-ic { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.sim-thumb { height: 120px; border-radius: 14px; margin: -6px -6px 8px; overflow: hidden; background: var(--surface-2); }
.sim-thumb svg { width: 100%; height: 100%; display: block; }
.order-pool, .order-slots { display: flex; flex-wrap: wrap; gap: 10px; }
.order-card { padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: .92rem; display: inline-flex; gap: 8px; align-items: center; transition: all .3s var(--spring); }
.order-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.order-card.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); pointer-events: none; }
.order-card.ko { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); animation: shake .45s; pointer-events: none; text-decoration: line-through; }
.slot { flex: 1; min-width: 150px; min-height: 92px; border-radius: 16px; border: 2px dashed var(--border-2); display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.slot .sl { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--muted); line-height: 1; }
.slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.slot.filled .sl { color: var(--ok); }
.slot.active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.lights-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.light-sw { border: 1.5px solid var(--border); background: var(--surface); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78rem; font-weight: 650; color: var(--text-2); transition: all .25s var(--ease); }
.light-sw svg { width: 34px; height: 24px; }
.light-sw.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.scenario { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface-2); border-radius: 14px; font-weight: 600; margin-bottom: 12px; }

/* ---------- Tests oficiales ---------- */
.off-card { display: flex; flex-direction: column; gap: 10px; }
.off-top { display: flex; gap: 14px; align-items: center; }
.off-date { width: 58px; height: 62px; border-radius: 14px; background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1.05; }
.off-date b { font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; }
.off-date small { font-size: .7rem; opacity: .75; }
:root[data-theme="dark"] .off-date { color: #111; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .off-date { color: #111; } }
.off-score { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); align-self: flex-start; }
.off-score.ok { background: var(--ok-soft); color: var(--ok); }
.year-sep { grid-column: 1 / -1; font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin: 18px 0 0; color: var(--text-2); }

/* ---------- Varios ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140px); background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 100; transition: transform .5s var(--spring); max-width: calc(100% - 32px); display: flex; gap: 10px; align-items: center; }
.toast.show { transform: translate(-50%, 0); }
@media (max-width: 900px) { .toast { bottom: 86px; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; width: 100%; height: 100%; }
.modal-bg { position: fixed; inset: 0; z-index: 130; background: rgba(20,16,10,.5); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 28px; padding: 34px 26px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); animation: pop .6s var(--spring); }
.modal .m-ic { width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty { text-align: center; padding: 50px 20px; }
.empty .m-ic { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.footer { border-top: 1px solid var(--border); padding: 24px 16px; text-align: center; color: var(--muted); font-size: .84rem; }
.footer p { max-width: 780px; margin: 0 auto; }
.page-head { margin-bottom: 20px; }
.page-head p { color: var(--text-2); max-width: 680px; font-size: 1.05rem; }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--c, var(--primary)); border-radius: 99px; transition: width 1.1s var(--ease); }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.page-enter { animation: pageIn .32s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
::view-transition-old(root) { animation: vtOut .22s ease both; }
::view-transition-new(root) { animation: vtIn .35s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }
.steps { counter-reset: s; display: grid; gap: 16px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step::before { counter-increment: s; content: counter(s); flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-family: var(--display); }
:root[data-theme="dark"] .step::before { color: #111; }
.step h4 { margin: 5px 0 3px; font-family: var(--font); }
.step p { margin: 0; color: var(--text-2); }
.tip-card { display: flex; gap: 16px; align-items: flex-start; }
.tip-card .t-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--tip-soft); color: var(--tip); display: grid; place-items: center; flex: none; }
.tip-card .tip-text { transition: opacity .35s, transform .35s var(--ease); }
.tip-card .tip-text.fade { opacity: 0; transform: translateY(6px); }
.count-up { font-variant-numeric: tabular-nums; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } .reveal, .lesson > .rv { opacity: 1; transform: none; } }

/* ---------- Cuenta, avatar y formularios ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; background: var(--av, var(--surface-3)); color: #fff; font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .02em; position: relative; }
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.lg { width: 88px; height: 88px; font-size: 2rem; }
.avatar-btn { border: 0; padding: 2px; border-radius: 50%; background: transparent; box-shadow: 0 0 0 1.5px var(--border-2); transition: box-shadow .2s, transform .25s var(--spring); }
.avatar-btn:hover { box-shadow: 0 0 0 2.5px var(--primary); transform: scale(1.04); }
.user-menu { position: absolute; right: 16px; top: 58px; width: 270px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 80; transform-origin: top right; animation: menuIn .25s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: scale(.95) translateY(-6px); } }
.user-menu .um-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .um-head b { display: block; line-height: 1.2; }
.user-menu .um-head small { color: var(--muted); font-size: .8rem; word-break: break-all; }
.user-menu a, .user-menu button.um-it { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px; border-radius: 11px; border: 0; background: transparent; color: var(--text); font-size: .92rem; font-weight: 550; text-decoration: none !important; text-align: left; }
.user-menu a:hover, .user-menu button.um-it:hover { background: var(--surface-2); }
.streak-chip { padding: 6px 12px 6px 10px; gap: 6px; }
.auth-wrap { max-width: 460px; margin: 0 auto; }
.auth-card { padding: 28px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .86rem; font-weight: 650; color: var(--text-2); }
.field input { width: 100%; padding: 12px 14px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s; }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--ink-soft); }
.field .hint { font-size: .78rem; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; font-size: .92rem; font-weight: 550; cursor: pointer; margin: 4px 0 18px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-err { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; animation: shake .4s; }
.form-ok { background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.mode-note { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; color: var(--text-2); background: var(--surface-2); padding: 12px 14px; border-radius: 14px; margin-top: 18px; }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: var(--c); transition: transform .2s var(--spring); }
.color-pick button.on { border-color: var(--surface); box-shadow: 0 0 0 2.5px var(--c); transform: scale(1.1); }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kpi { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.kpi b { font-family: var(--display); font-size: 1.5rem; display: block; line-height: 1.1; }
.kpi small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.sync-dot.off { background: var(--muted); }
