/* BeamUp — estilos. Móvil primero; modo oscuro automático. */
:root {
  --bg: #F6F3EC; --card: #FFFFFF; --ink: #14213D; --muted: #6B7385; --line: #E4DFD4;
  --accent: #F28C28; --accent-d: #C96E12; --blue: #2F7BEA; --blue-d: #1F5FBE;
  --ok: #1FA866; --ok-d: #168250; --ok-bg: #DCF5E7; --bad: #E5484D; --bad-d: #B8343A; --bad-bg: #FDE4E5;
  --gold: #F5B700; --lock: #D6D1C5; --lock-ink: #9A9486; --dg-fill: #ECE6D9; --sel: #FFD7AE;
  --shadow: 0 4px 0;
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1525; --card: #16213A; --ink: #E9EEF7; --muted: #95A2BA; --line: #26344F;
    --ok-bg: #11342A; --bad-bg: #3B1B22; --lock: #2B3954; --lock-ink: #6F7D98; --dg-fill: #22314F; --sel: #7C4B1C;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- splash ---------- */
.splash { height: 100dvh; display: grid; place-items: center; }
.splash svg { width: 84px; animation: bob 1.2s ease-in-out infinite; }

/* ---------- shell ---------- */
.shell { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; border-bottom: 2px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 19px; letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; }
.stats { display: flex; gap: 6px; }
.stat { display: flex; align-items: center; gap: 4px; font-weight: 800; padding: 6px 8px; border-radius: 12px; border: 0; background: none; font-size: 16px; }
.stat svg { width: 22px; height: 22px; }
.stat.streak { color: var(--lock-ink); }
.stat.streak.on { color: var(--accent); }
.stat.gems { color: var(--blue); }
.stat.hearts { color: var(--bad); }
.stat:active { background: var(--line); }

.content { flex: 1; overflow-y: auto; padding: 16px 16px 28px; -webkit-overflow-scrolling: touch; }
.tabbar { display: flex; border-top: 2px solid var(--line); background: var(--card); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; border: 0; background: none; padding: 8px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 700; position: relative; }
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--accent); }
.tab.on::before { content: ""; position: absolute; top: -2px; left: 22%; right: 22%; height: 3px; border-radius: 3px; background: var(--accent); }
.tab .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--card); }

.h1 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; margin-bottom: 14px; }
.h1.tight { margin: 0 0 6px; font-size: 22px; }
.h2 { font-size: 17px; font-weight: 800; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.udot { width: 10px; height: 10px; border-radius: 50%; background: var(--uc); display: inline-block; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.card.list { padding: 4px 14px; }

/* ---------- botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: var(--r); padding: 14px 16px; margin-top: 10px;
  font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent); color: #fff; box-shadow: var(--shadow) var(--accent-d);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active:not([disabled]) { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-d); }
.btn.blue { background: var(--blue); box-shadow: var(--shadow) var(--blue-d); }
.btn.blue:active { box-shadow: 0 1px 0 var(--blue-d); }
.btn.ok { background: var(--ok); box-shadow: var(--shadow) var(--ok-d); }
.btn.ok:active { box-shadow: 0 1px 0 var(--ok-d); }
.btn.bad { background: var(--bad); box-shadow: var(--shadow) var(--bad-d); }
.btn.bad:active { box-shadow: 0 1px 0 var(--bad-d); }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: var(--shadow) var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.ghost.danger { color: var(--bad); }
.btn[disabled] { background: var(--lock); color: var(--lock-ink); box-shadow: var(--shadow) color-mix(in srgb, var(--lock) 70%, #000 12%); cursor: default; }
.btn.sm { width: auto; padding: 9px 12px; margin: 0; font-size: 13px; letter-spacing: .02em; flex-shrink: 0; gap: 4px; }
.btn.sm svg { width: 16px; height: 16px; }
.icon-btn { border: 0; background: none; padding: 6px; color: var(--muted); border-radius: 10px; }
.icon-btn svg { width: 28px; height: 28px; }
.link { border: 0; background: none; color: var(--blue); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; padding: 6px; }
.link svg { width: 18px; height: 18px; }

/* ---------- ruta ---------- */
.install-banner { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 14px; }
.install-banner > svg { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.install-banner div { flex: 1; display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.install-banner b { color: var(--ink); font-size: 15px; }
.install-banner .x { border: 0; background: none; color: var(--muted); padding: 2px; }
.install-banner .x svg { width: 18px; height: 18px; }
.goal-strip { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.goal-strip b { color: var(--ink); white-space: nowrap; }
.mini-bar { flex: 1; height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.mini-bar.wide { margin: 6px 0 4px; }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s; min-width: 0; }

.unit { margin-bottom: 8px; }
.unit-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--uc); color: #fff; border-radius: 20px; padding: 16px 16px 16px 18px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--uc) 70%, #000);
}
.unit-banner .lvl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.unit-banner h2 { font-size: 21px; font-weight: 900; letter-spacing: -.01em; margin: 2px 0; }
.unit-banner p { font-size: 14px; opacity: .9; }
.guide { border: 2px solid rgba(255,255,255,.45); background: rgba(255,255,255,.14); color: #fff; border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.guide svg { width: 22px; height: 22px; }
.unit.locked .unit-banner { background: var(--lock); color: var(--lock-ink); box-shadow: 0 5px 0 color-mix(in srgb, var(--lock) 75%, #000); }
.unit.locked .guide { border-color: color-mix(in srgb, var(--lock-ink) 50%, transparent); color: var(--lock-ink); background: transparent; }
.lock-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin: -6px 0 18px; }
.lock-note svg { width: 16px; height: 16px; }
.end-note { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 20px 20px; }

.path { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 48px 0 32px; }
.node {
  width: 72px; height: 66px; border-radius: 50%; border: 0; position: relative;
  background: var(--uc); color: #fff; transform: translateX(var(--x));
  box-shadow: 0 7px 0 color-mix(in srgb, var(--uc) 68%, #000);
  display: grid; place-items: center; transition: transform .08s, box-shadow .08s;
}
.node svg { width: 34px; height: 34px; }
.node:active { transform: translateX(var(--x)) translateY(5px); box-shadow: 0 2px 0 color-mix(in srgb, var(--uc) 68%, #000); }
.node.boss { width: 84px; height: 76px; }
.node.boss svg { width: 40px; height: 40px; }
.node.done { background: var(--gold); box-shadow: 0 7px 0 #C08F00; color: #fff; }
.node.locked { background: var(--lock); color: var(--lock-ink); box-shadow: 0 7px 0 color-mix(in srgb, var(--lock) 72%, #000); }
.node.current { outline: 6px solid color-mix(in srgb, var(--uc) 28%, transparent); outline-offset: 5px; animation: glow 2s ease-in-out infinite; }
.bubble {
  position: absolute; bottom: calc(100% + 12px); z-index: 2; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--uc); border: 2px solid var(--line); border-radius: 12px;
  padding: 6px 12px; font-size: 13px; font-weight: 900; letter-spacing: .06em; white-space: nowrap;
  animation: bob 1.4s ease-in-out infinite;
}
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--line); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 12, 22, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .2s; }
.modal {
  background: var(--card); width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 24px 20px calc(env(safe-area-inset-bottom) + 20px); animation: up .28s cubic-bezier(.2, .9, .3, 1.1);
}
.modal h3 { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.modal p { margin-bottom: 8px; }
.node-modal .lvl { font-size: 12px; font-weight: 800; color: var(--uc); text-transform: uppercase; letter-spacing: .08em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 99px; background: var(--bg); border: 2px solid var(--line); font-weight: 700; font-size: 14px; }
.chip svg { width: 16px; height: 16px; }
.chip.new { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-color: transparent; color: var(--accent-d); text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
@media (prefers-color-scheme: dark) { .chip.new { color: var(--accent); } }
.big-ic { width: 76px; height: 76px; margin: 0 auto 10px; }
.big-ic svg { width: 100%; height: 100%; }
.big-ic.heart { color: var(--bad); }
.big-ic.broken { animation: shake .5s; filter: grayscale(.3); }
.steps { padding-left: 22px; line-height: 1.8; }
.guide-list { margin: 10px 0; }
.welcome .avatar.big { width: 84px; height: 84px; margin: 0 auto 8px; }
.rules { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; gap: 12px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.rules li b { display: block; color: var(--ink); font-size: 15px; }
.rules .r { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg); }
.rules .r svg { width: 22px; height: 22px; }
.r.heart { color: var(--bad); } .r.flame { color: var(--accent); } .r.gem { color: var(--blue); } .r.trophy { color: var(--gold); }

/* ---------- filas / listas ---------- */
.g-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.g-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g-row b { font-size: 16px; }
.g-row span { color: var(--muted); font-size: 14px; }
.card.list > * + * { border-top: 2px solid var(--line); }
.err-count { font-style: normal; font-weight: 800; color: var(--bad); }
.seen { font-style: normal; color: var(--ok); }
.seen svg { width: 20px; height: 20px; }
.g-item summary { list-style: none; cursor: pointer; }
.g-item summary::-webkit-details-marker { display: none; }
.g-ex { display: flex; gap: 10px; padding: 0 0 12px 0; font-size: 14px; }
.g-ex p + p { margin-top: 2px; }

.say { border: 0; background: var(--blue); color: #fff; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 3px 0 var(--blue-d); }
.say svg { width: 22px; height: 22px; }
.say:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-d); }
.say.sm { width: 34px; height: 34px; border-radius: 11px; }
.say.sm svg { width: 18px; height: 18px; }
.say.big { width: 52px; height: 52px; border-radius: 16px; }
.say.big svg { width: 28px; height: 28px; }
.say.huge { width: 110px; height: 110px; border-radius: 28px; box-shadow: 0 6px 0 var(--blue-d); }
.say.huge svg { width: 56px; height: 56px; }
.say.slow { width: auto; height: 52px; padding: 0 16px; font-weight: 800; background: var(--card); color: var(--blue); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }

/* ---------- repaso / perfil ---------- */
.empty { text-align: center; padding: 40px 12px; }
.empty > svg { width: 64px; height: 64px; margin: 0 auto 12px; color: var(--lock-ink); }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 8px; }
.review-hero .rh-num { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.review-hero .rh-num b { font-size: 46px; font-weight: 900; color: var(--accent); line-height: 1; }
.review-hero .rh-num span { font-weight: 700; }
.review-hero p { font-size: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.tile-stat { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; }
.tile-stat b { display: block; font-size: 22px; font-weight: 900; }
.tile-stat span { font-size: 12px; color: var(--muted); font-weight: 700; }

.goal-card { display: flex; align-items: center; gap: 16px; }
.goal-card > div { display: flex; flex-direction: column; }
.goal-num { font-size: 24px; font-weight: 900; }
.ring { width: 86px; height: 86px; transform: rotate(-90deg); flex-shrink: 0; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.sc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sc-head svg { width: 26px; height: 26px; color: var(--accent); }
.sc-head b { flex: 1; font-size: 17px; }
.week-dots { display: flex; justify-content: space-between; }
.week-dots > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.week-dots i { width: 34px; height: 34px; border-radius: 50%; background: var(--line); display: grid; place-items: center; color: #fff; }
.week-dots i svg { width: 20px; height: 20px; }
.week-dots .on i { background: var(--accent); }
.week-dots .today span { color: var(--accent); }
.streak-card .small { margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.streak-card .small svg { width: 16px; height: 16px; color: var(--blue); }
.mission { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.m-txt { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.mission .mini-bar { flex: none; height: 10px; }
.claimed { color: var(--ok); }
.claimed svg { width: 28px; height: 28px; }
.mission.chest > svg { width: 34px; height: 34px; color: var(--gold); flex-shrink: 0; }
.mission.chest.ready > svg { animation: bob 1s ease-in-out infinite; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.shop-row > div { flex: 1; display: flex; flex-direction: column; }
.shop-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex-shrink: 0; }
.shop-ic svg { width: 24px; height: 24px; }
.shop-ic.heart { color: var(--bad); } .shop-ic.shield { color: var(--blue); }

.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 0 12px; margin-bottom: 8px; }
.search svg { width: 20px; height: 20px; color: var(--muted); }
.search input { flex: 1; border: 0; background: none; padding: 13px 0; font-size: 16px; color: var(--ink); outline: none; }

.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.profile-head > div:last-child { flex: 1; }
.avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); display: grid; place-items: center; flex-shrink: 0; }
.avatar svg { width: 70%; height: 70%; }
.week { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.wcol { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.wcol i { width: 100%; background: color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 7px 7px 3px 3px; display: block; }
.wcol.today i { background: var(--accent); }
.wcol em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); min-height: 14px; }
.wcol span { font-size: 12px; font-weight: 800; color: var(--muted); }
.sw-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-weight: 700; }
.switch { width: 52px; height: 30px; border-radius: 99px; border: 0; background: var(--lock); position: relative; transition: background .2s; flex-shrink: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch.on { background: var(--ok); }
.switch.on i { transform: translateX(22px); }
.set-block { padding: 10px 0 4px; font-weight: 700; }
.set-block > span { display: block; margin-bottom: 8px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 10px 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 14px; }
.seg button.on { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
.app-row { display: flex; justify-content: space-between; padding: 6px 0; font-weight: 600; }
.app-row b { color: var(--muted); }
.app-row b.okc { color: var(--ok); }

/* ---------- lección ---------- */
.lesson { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; }
.l-top { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 14px 6px; }
.bar { flex: 1; height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ok); border-radius: 99px; transition: width .45s cubic-bezier(.3, .9, .4, 1.2); position: relative; min-width: 16px; }
.bar-fill::after { content: ""; position: absolute; top: 3px; left: 8px; right: 8px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.l-hearts { display: flex; align-items: center; gap: 4px; color: var(--bad); font-weight: 900; font-size: 18px; }
.l-hearts svg { width: 26px; height: 26px; }
.l-hearts.hit { animation: shake .45s; }
.l-badge.free { color: var(--blue); }
.l-badge svg { width: 26px; height: 26px; }
.boss-strip { margin: 2px 16px 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.boss-strip svg { width: 18px; height: 18px; }
.combo { text-align: center; color: var(--accent); font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 4px; animation: pop .35s; }
.combo svg { width: 18px; height: 18px; }
.l-body { flex: 1; overflow-y: auto; padding: 8px 18px 16px; }
.step-anim { animation: slidein .28s ease-out; }
.q-title { font-size: 23px; font-weight: 900; letter-spacing: -.01em; margin: 10px 0 18px; }
.word-card { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.word-card span { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.word-card.es span { font-size: 28px; }
.word-card.small { margin-bottom: 12px; }
.word-card.small span { font-size: 24px; }

.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; min-height: 58px;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--card);
  font-size: 17px; font-weight: 700; box-shadow: var(--shadow) var(--line); transition: transform .06s;
}
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt .kbd { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.opt.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); box-shadow: var(--shadow) var(--blue); color: var(--blue); }
.opt.sel .kbd { border-color: var(--blue); color: var(--blue); }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); box-shadow: var(--shadow) var(--ok); color: var(--ok); }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); box-shadow: var(--shadow) var(--bad); color: var(--bad); animation: shake .4s; }
.opt:disabled { cursor: default; }

.listen-row { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 8px 0 28px; }
.sentence { font-size: 21px; font-weight: 700; line-height: 1.55; margin-bottom: 6px; }
.blank { display: inline-block; min-width: 80px; border-bottom: 3px solid var(--ink); color: transparent; line-height: 1.1; }
.blank.filled { color: var(--ok); border-color: var(--ok); }
.ex-es { font-size: 15px; margin-bottom: 20px; }
.ans {
  width: 100%; font-size: 20px; font-weight: 700; padding: 16px; border-radius: var(--r);
  border: 2px solid var(--line); background: var(--card); color: var(--ink); outline: none;
}
.ans:focus { border-color: var(--blue); }
.ans.ok { border-color: var(--ok); background: var(--ok-bg); }
.ans.bad { border-color: var(--bad); background: var(--bad-bg); animation: shake .4s; }
.type-help { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.pattern { display: flex; flex-wrap: wrap; gap: 3px; }
.pattern i { width: 16px; height: 24px; border-bottom: 2px solid var(--muted); font-style: normal; font-weight: 800; text-align: center; color: var(--blue); font-size: 16px; }
.pattern i.sp { border: 0; width: 10px; }
.pattern i.ch { border: 0; color: var(--muted); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  min-height: 62px; padding: 10px; border: 2px solid var(--line); border-radius: var(--r); background: var(--card);
  font-size: 16px; font-weight: 700; box-shadow: var(--shadow) var(--line); transition: opacity .25s, transform .06s;
}
.tile.sel { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); box-shadow: var(--shadow) var(--blue); }
.tile.matched { opacity: .3; border-color: var(--ok); color: var(--ok); box-shadow: none; transform: translateY(3px); pointer-events: none; }
.tile.wrong { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); box-shadow: var(--shadow) var(--bad); animation: shake .4s; }

.intro { text-align: center; padding-top: 8px; }
.intro-word { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 4px; }
.intro-word span { font-size: 38px; font-weight: 900; letter-spacing: -.02em; }
.intro-word.long span { font-size: 29px; }
.intro-es { font-size: 22px; font-weight: 700; color: var(--muted); margin-bottom: 22px; }
.ex-box { display: flex; gap: 12px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 14px; }
.ex-en { font-size: 17px; font-weight: 600; }
.ex-en b { color: var(--accent-d); }
@media (prefers-color-scheme: dark) { .ex-en b { color: var(--accent); } }
.ex-box .ex-es { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.l-foot { padding: 14px 18px calc(env(safe-area-inset-bottom) + 16px); border-top: 2px solid var(--line); transition: background .2s; }
.l-foot .btn { margin-top: 0; }
.l-foot.ok { background: var(--ok-bg); border-color: transparent; }
.l-foot.bad { background: var(--bad-bg); border-color: transparent; }
.fb { animation: up .25s ease-out; }
.fb-head { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 900; margin-bottom: 6px; }
.fb-head svg { width: 30px; height: 30px; background: currentColor; border-radius: 50%; padding: 4px; }
.fb-head svg path { fill: var(--card); }
.ok .fb-head { color: var(--ok); }
.bad .fb-head { color: var(--bad); }
.fb-answer { font-size: 18px; font-weight: 800; color: var(--bad); margin-bottom: 6px; }
.fb-note { font-size: 14px; margin-bottom: 6px; }
.fb-ex { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; }

/* ---------- dibujos ---------- */
.diagram { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px; color: var(--ink); }
.diagram.hl { margin-top: 14px; padding: 6px; }
.diagram.hl svg { max-height: 180px; margin: 0 auto; }
.dg { width: 100%; height: auto; }
.dg-decor { stroke: var(--muted); stroke-width: 2; fill: none; }
.dg-decor.dash { stroke-dasharray: 6 5; opacity: .7; }
.dg-decor-solid { fill: var(--muted); }
.dg-decor-solid.soft { fill: var(--dg-fill); stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.dg-decor-fill { color: var(--muted); }
.rg { pointer-events: none; }
.diagram.quiz .rg { pointer-events: all; cursor: pointer; }
.rg :is(rect, path, polygon, circle):not(.hit):not(.ln) { fill: var(--dg-fill); stroke: var(--ink); stroke-width: 1.6; transition: fill .15s; }
.rg .arr { fill: var(--ink) !important; stroke: none !important; }
.rg .ln { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.rg .ln.thick { stroke-width: 9; stroke-linecap: round; }
.rg .hit { fill: transparent; stroke: none; }
.diagram.quiz .rg:hover :is(rect, path, polygon, circle):not(.hit):not(.ln):not(.arr) { fill: color-mix(in srgb, var(--blue) 18%, var(--dg-fill)); }
.rg.sel :is(rect, path, polygon, circle):not(.hit):not(.ln):not(.arr) { fill: color-mix(in srgb, var(--blue) 45%, var(--dg-fill)); }
.rg.sel .ln { stroke: var(--blue); }
.rg.hl :is(rect, path, polygon, circle):not(.hit):not(.ln):not(.arr) { fill: var(--accent); }
.rg.hl .ln { stroke: var(--accent); }
.rg.ok :is(rect, path, polygon, circle):not(.hit):not(.ln):not(.arr) { fill: var(--ok); }
.rg.ok .ln { stroke: var(--ok); }
.rg.bad :is(rect, path, polygon, circle):not(.hit):not(.ln):not(.arr) { fill: var(--bad); }
.rg.bad .ln { stroke: var(--bad); }

/* ---------- resultados ---------- */
.result { min-height: 100dvh; max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 40px) 22px calc(env(safe-area-inset-bottom) + 24px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.r-ic { width: 120px; height: 120px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 0 var(--accent-d); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); margin-bottom: 8px; }
.r-ic svg { width: 64px; height: 64px; }
.r-ic.gold { background: var(--gold); box-shadow: 0 8px 0 #C08F00; }
.result.fail .r-ic { background: var(--lock); color: var(--lock-ink); box-shadow: 0 8px 0 color-mix(in srgb, var(--lock) 70%, #000); }
.result h1 { font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.result p { color: var(--muted); }
.result p b { color: var(--ink); }
.streak-up { display: flex; align-items: center; gap: 6px; color: var(--accent) !important; font-weight: 900; font-size: 18px; }
.streak-up svg { width: 24px; height: 24px; }
.result .muted { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-weight: 700; }
.result .muted svg { width: 18px; height: 18px; }
.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin: 14px 0 4px; }
.r-stat { border-radius: 16px; border: 2px solid var(--c); overflow: hidden; background: var(--card); }
.r-stat span { display: block; background: var(--c); color: #fff; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 5px 0; }
.r-stat b { display: block; font-size: 22px; font-weight: 900; padding: 10px 0; color: var(--c); }
.r-stat.xp { --c: var(--gold); } .r-stat.acc { --c: var(--ok); } .r-stat.time { --c: var(--blue); }
.r-actions { width: 100%; margin-top: auto; padding-top: 20px; }

/* ---------- toasts / confeti ---------- */
#toasts { position: fixed; top: calc(env(safe-area-inset-top) + 12px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 14px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 16px; font-weight: 700; font-size: 14px; max-width: 520px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: drop .3s ease-out; }
.toast span { display: flex; align-items: center; gap: 6px; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast button { border: 0; background: var(--accent); color: #fff; font-weight: 800; padding: 8px 12px; border-radius: 10px; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .35s; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 2px; animation: fall linear forwards; }

/* ---------- animaciones ---------- */
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }
.splash svg, .mission.chest.ready > svg { animation-name: bob2; }
@keyframes bob2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes glow { 0%, 100% { outline-color: color-mix(in srgb, var(--uc) 28%, transparent); } 50% { outline-color: color-mix(in srgb, var(--uc) 55%, transparent); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
