:root {
  --bg: #f6f3ee; --bg-2: #efebe4; --card: #ffffff;
  --text: #1d1c1a; --text-2: #6f6b64; --text-3: #a39e95;
  --line: rgba(60, 50, 35, .11); --fill: rgba(110, 100, 85, .1); --fill-2: rgba(110, 100, 85, .17);
  --bar: rgba(246, 243, 238, .82);
  --tint: #16927b; --tint-soft: rgba(22, 146, 123, .12);
  --accent: #f28a1f; --accent-soft: rgba(242, 138, 31, .14);
  --ok: #2f9a5d; --ok-soft: rgba(47, 154, 93, .12);
  --bad: #d9483b; --bad-soft: rgba(217, 72, 59, .1);
  --gold: #e0ac2e; --silver: #a3abb4; --bronze: #c98552;
  --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 6px 20px rgba(60, 45, 20, .05);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --bg-2: #1a1918; --card: #1f1e1c;
    --text: #f2efea; --text-2: #a9a49b; --text-3: #6f6b64;
    --line: rgba(255, 255, 255, .09); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .12);
    --bar: rgba(18, 18, 17, .8);
    --tint: #2fbf9f; --tint-soft: rgba(47, 191, 159, .16);
    --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.4 -apple-system, system-ui, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--tint); text-decoration: none; }
svg { display: block; }

/* ——— Barra de navegación ——— */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: calc(48px + var(--safe-t)); padding-top: var(--safe-t);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid transparent; transition: border-color .2s;
}
.nav.scrolled, .nav.detail { border-bottom-color: var(--line); }
.nav-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav.scrolled .nav-title, .nav.detail .nav-title { opacity: 1; }
.nav-back { justify-self: start; display: flex; align-items: center; gap: 2px; color: var(--tint); padding: 8px 12px 8px 6px; font-size: 17px; }
.nav-right { justify-self: end; padding-right: 12px; }

/* ——— Vista ——— */
.view { padding: calc(56px + var(--safe-t)) 16px calc(100px + var(--safe-b)); max-width: 720px; margin: 0 auto; min-height: 100vh; }
.view.detail { padding-top: calc(64px + var(--safe-t)); }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: .3px; margin: 4px 4px 2px; }
.subtitle { color: var(--text-2); margin: 0 4px 18px; font-size: 15px; }
.h2 { font-size: 22px; font-weight: 700; margin: 0 4px 6px; }
.section-head { color: var(--text-2); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; margin: 26px 16px 7px; }
.section-foot { color: var(--text-2); font-size: 13px; margin: 7px 16px 0; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ——— Tarjetas y grupos ——— */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 52px;
  padding: 10px 16px; position: relative; background: none;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 60px; border-top: .5px solid var(--line); }
.group.plain .row + .row::before { left: 16px; }
button.row:active, a.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row > svg { width: 22px; height: 22px; flex: none; } /* icono suelto en una fila: que nunca crezca */
.row-title { font-size: 17px; color: var(--text); }
.row-title .badge { margin-left: 6px; vertical-align: 1px; font-size: 11px; padding: 1px 7px; }
.row-sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.row-value { color: var(--text-2); font-size: 15px; }
.chev { color: var(--text-3); width: 8px; flex: none; }
.icon-tile { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.icon-tile svg { width: 19px; height: 19px; }

/* ——— Botones ——— */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 14px;
  background: var(--tint); color: #fff; font-weight: 600; font-size: 17px; transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.secondary { background: var(--fill); color: var(--tint); }
.btn.accent { background: var(--accent); }
.btn.small { height: 36px; width: auto; padding: 0 16px; font-size: 15px; border-radius: 18px; }
.btn-row { display: flex; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--tint); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.link-btn { color: var(--tint); font-size: 15px; padding: 6px 4px; }

/* ——— Control segmentado ——— */
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; padding: 6px 8px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text); }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #3a3936; } }

/* ——— Interruptor ——— */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--fill-2); border-radius: 31px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ——— Inicio ——— */
.hero { display: flex; gap: 14px; align-items: center; }
.hero img { width: 76px; height: 76px; flex: none; }
.hero-text b { display: block; font-size: 17px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: var(--fill); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.stat svg { width: 22px; height: 22px; flex: none; }
.stat-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-2); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--fill-2); flex: none; display: grid; place-items: center; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 14px; height: 14px; }
.add-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--tint); display: grid; place-items: center; flex: none; }
.week { display: flex; justify-content: space-between; align-items: flex-end; height: 86px; gap: 6px; margin-top: 4px; }
.week-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bar { width: 100%; max-width: 28px; border-radius: 6px; background: var(--tint); min-height: 4px; }
.week-bar.zero { background: var(--fill-2); }
.week-label { font-size: 11px; color: var(--text-2); }
.week-day.today .week-label { color: var(--text); font-weight: 600; }
.banner { display: flex; gap: 12px; align-items: center; border-radius: var(--radius); padding: 14px 16px; background: var(--accent-soft); margin-bottom: 12px; }
.banner svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.bar { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ——— Rejilla de práctica ——— */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { color: var(--text); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 22px; min-height: 120px; }
.tile:active { transform: scale(.98); }
.tile-title { font-weight: 600; font-size: 17px; }
.tile-sub { font-size: 13px; color: var(--text-2); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--fill); color: var(--text-2); }
.badge.tint { background: var(--tint-soft); color: var(--tint); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.medal { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px dashed var(--fill-2); }
.medal.m1 { background: var(--bronze); border: 0; } .medal.m2 { background: var(--silver); border: 0; } .medal.m3 { background: var(--gold); border: 0; }

/* ——— Lecciones y ejercicios ——— */
.explain h3 { font-size: 15px; margin: 0 0 4px; color: var(--tint); }
.explain p { margin: 0; }
.explain .item + .item { margin-top: 14px; padding-top: 14px; border-top: .5px solid var(--line); }
.progress { height: 8px; background: var(--fill); border-radius: 4px; overflow: hidden; margin: 4px 0 22px; }
.progress > i { display: block; height: 100%; background: var(--tint); border-radius: 4px; transition: width .3s; }
.q-label { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.q { font-size: 24px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.q-es { color: var(--text-2); margin-bottom: 18px; }
.q-text { background: var(--fill); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; font-size: 17px; line-height: 1.45; }
.opts { display: grid; gap: 10px; margin-top: 18px; }
.opt { background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 15px 16px; text-align: left; font-size: 17px; border: 2px solid transparent; }
.opt.sel { border-color: var(--tint); background: var(--tint-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.field { width: 100%; height: 52px; border-radius: 14px; border: 0; background: var(--card); box-shadow: var(--shadow); padding: 0 16px; font-size: 19px; outline: 2px solid transparent; margin-top: 18px; }
.field:focus { outline-color: var(--tint); }
.field.right { outline-color: var(--ok); } .field.wrong { outline-color: var(--bad); }
.answer-zone { min-height: 58px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; margin-top: 10px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { background: var(--card); box-shadow: var(--shadow); border-radius: 10px; padding: 9px 13px; font-size: 17px; border: .5px solid var(--line); }
.chip.used { opacity: .25; pointer-events: none; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 14px 16px calc(14px + var(--safe-b)); background: var(--bar); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: .5px solid var(--line); }
.dock-inner { max-width: 688px; margin: 0 auto; }
.feedback { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; }
.feedback b { display: block; font-size: 17px; }
.feedback.ok { background: var(--ok-soft); color: var(--ok); }
.feedback.ko { background: var(--bad-soft); color: var(--bad); }
.feedback .fx { color: var(--text); margin-top: 4px; }
body.has-dock .tabbar { display: none; }
.result { text-align: center; padding-top: 30px; }
.result img { width: 140px; height: 140px; margin: 0 auto 8px; }
.result .big { font-size: 48px; font-weight: 800; }

/* ——— Historias ——— */
.story-cover {
  position: relative; display: block; margin: 0 0 14px; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--bg-2); box-shadow: var(--shadow);
}
.story-cover img, .cover-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.story-cover .badge {
  position: absolute; z-index: 1; top: 10px; left: 10px;
  background: var(--bg); color: var(--tint); box-shadow: 0 1px 2px rgba(60, 45, 20, .14);
}
.cover-thumb {
  position: relative; width: 72px; height: 40.5px; flex: none; border-radius: 8px; overflow: hidden;
  background: var(--bg-2); box-shadow: inset 0 0 0 .5px var(--line);
}
.group.stories .row + .row::before { left: 100px; } /* 16 de padding + 72 de miniatura + 12 de hueco */
.story-cover.is-fallback, .cover-thumb.is-fallback { display: grid; place-items: center; }
.story-cover.is-fallback {
  color: var(--tint);
  background: radial-gradient(120% 80% at 0% 0%, rgba(224, 172, 46, .35), transparent 52%), linear-gradient(165deg, rgba(22, 146, 123, .2), var(--bg-2));
}
.story-cover.is-fallback > svg { width: 44px; height: 44px; }
.cover-thumb.is-fallback { background: #3b82d6; color: #fff; box-shadow: none; }
.cover-thumb.is-fallback > svg { width: 20px; height: 20px; }
.story-line { font-size: 20px; line-height: 1.6; margin: 0; padding: 10px 6px; border-radius: 10px; transition: background .2s; }
.story-line.speaking { background: var(--accent-soft); }
.story-line + .story-line { border-top: .5px solid var(--line); }
.w { border-radius: 4px; cursor: pointer; }
.w:active, .w.hl { background: var(--tint-soft); }
.tr { display: block; font-size: 15px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.story-tools { display: flex; gap: 8px; margin: 0 0 14px; }

/* ——— Tarjetas ——— */
.flash { perspective: 1200px; height: 280px; margin: 8px 0 18px; }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.flash-face.back { transform: rotateY(180deg); }
.flash-word { font-size: 32px; font-weight: 700; }
.flash-hint { color: var(--text-3); font-size: 13px; position: absolute; bottom: 16px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grades button { border-radius: 12px; padding: 10px 4px; background: var(--fill); font-size: 14px; font-weight: 600; line-height: 1.2; }
.grades button small { display: block; font-weight: 400; font-size: 11px; color: var(--text-2); margin-top: 2px; }
.grades .g0 { color: var(--bad); } .grades .g1 { color: var(--accent); } .grades .g2 { color: var(--ok); } .grades .g3 { color: var(--tint); }

/* ——— Emparejar y rápido ——— */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .opt { text-align: center; padding: 14px 8px; font-size: 16px; min-height: 58px; }
.match .opt.done { opacity: .3; pointer-events: none; border-color: var(--ok); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); }
.speed-card { text-align: center; padding: 34px 16px; }
.speed-en { font-size: 30px; font-weight: 700; }
.speed-es { font-size: 20px; color: var(--text-2); margin-top: 8px; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.yn .btn.no { background: var(--bad); }
.yn .btn.yes { background: var(--ok); }

/* ——— Barra de pestañas ——— */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 6px 8px calc(6px + var(--safe-b)); background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--text-3); padding: 2px 4px; min-width: 56px; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--tint); }

/* ——— Hoja inferior y aviso ——— */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .3); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; border-radius: 14px 14px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); animation: up .32s cubic-bezier(.2, .9, .25, 1); max-height: min(90vh, calc(var(--vvh, 100vh) - 24px)); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; will-change: transform; }
.sheet-wrap { transition: background-color .24s; }
.sheet-wrap.out { background-color: transparent !important; }
.sheet-wrap.out .sheet { transform: translateY(calc(100% + 40px)) !important; transition: transform .24s cubic-bezier(.4, 0, 1, 1) !important; animation: none; }
/* El agarrador es más fácil de coger: zona táctil más alta */
.sheet-grabber { position: relative; }
.sheet-grabber::before { content: ''; position: absolute; inset: -14px -60px; }
/* Teclado abierto: sin barra de pestañas; botones fijos y hojas justo encima del teclado */
body.kb-open .tabbar { display: none; }
body.kb-open .dock { transform: translateY(calc(-1 * var(--kb, 0px))); padding-bottom: 10px; }
body.kb-open .sheet-wrap { bottom: var(--kb, 0px); }
body.kb-open .sheet { padding-bottom: 16px; }
body.kb-open.mchat-on .view { padding-bottom: calc(150px + var(--kb, 0px)); }
body.sheet-open { overflow: hidden; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; top: calc(56px + var(--safe-t)); transform: translate(-50%, -200%); visibility: hidden; z-index: 60; background: var(--card); color: var(--text); box-shadow: 0 8px 30px rgba(0, 0, 0, .15); border-radius: 22px; padding: 10px 18px; font-size: 15px; font-weight: 600; transition: transform .35s cubic-bezier(.2, .8, .2, 1); white-space: normal; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.empty { text-align: center; padding: 40px 20px 10px; }
.empty img { width: 120px; height: 120px; margin: 0 auto 10px; }
.input-label { font-size: 13px; color: var(--text-2); margin: 14px 4px 6px; display: block; }
.sheet .field { margin-top: 0; }
.verb-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.verb-table th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; text-transform: uppercase; padding: 10px 8px; }
.verb-table td { padding: 10px 8px; border-top: .5px solid var(--line); }
.verb-table td:last-child { color: var(--text-2); }
input[type=range] { width: 100%; accent-color: var(--tint); }

/* ——— Shadowing ——— */
.shadow-card { text-align: center; padding: 28px 18px 18px; }
.shadow-line { font-size: 26px; font-weight: 600; line-height: 1.5; }
.sw { border-radius: 6px; padding: 0 2px; transition: color .2s, background .2s; }
.sw.now { background: var(--accent-soft); }
.sw.ok { color: var(--ok); }
.sw.miss { color: var(--text-3); }
.heard { font-size: 15px; margin-top: 14px; min-height: 21px; font-style: italic; }
.shadow-ctrls { display: flex; justify-content: center; align-items: center; gap: 28px; margin: 26px 0 10px; }
.mic { width: 78px; height: 78px; border-radius: 50%; background: var(--tint); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(22, 146, 123, .35); transition: transform .15s, background .2s; }
.mic svg { width: 32px; height: 32px; }
.mic:active { transform: scale(.94); }
.mic.rec { background: var(--bad); box-shadow: 0 0 0 0 rgba(217, 72, 59, .5); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 18px rgba(217, 72, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 72, 59, 0); } }
#result .btn-row { margin-top: 4px; }

/* ——— Tuki animado ——— */
.tuki { flex: none; display: inline-block; }
.tuki svg { width: 100%; height: 100%; overflow: visible; display: block; }
.tuki g, .tuki path, .tuki ellipse, .tuki circle, .tuki text { transform-box: fill-box; }
/* Con GSAP (js/tuki-anim.js) los puntos de giro van en coordenadas del dibujo */
.tuki.tk-js g, .tuki.tk-js path, .tuki.tk-js ellipse, .tuki.tk-js circle, .tuki.tk-js text, .tuki.tk-js rect { transform-box: view-box; }
.tuki .t-all { transform-origin: 50% 100%; }
.tuki .t-body { transform-origin: 50% 100%; }
.tuki .t-eye { transform-origin: 50% 50%; }
.tuki:not(.tk-js) .t-eye { animation: t-blink 4.6s infinite; }
.tuki .t-wing { transform-origin: 70% 10%; }
.tuki .t-head { transform-origin: 30% 80%; }
.tuki .t-beak-low { transform-origin: 0% 50%; }
.tuki .t-heart, .tuki .t-zz, .tuki .t-tear, .tuki .t-bang, .tuki .t-sleep, .tuki .t-spark, .tuki .t-sweat, .tuki .t-mad, .tuki .t-lines { opacity: 0; transition: opacity .3s; }
.tuki .t-heart { transform-origin: 50% 100%; }
@keyframes t-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes t-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-1.5deg); } }
@keyframes t-wave { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(-38deg); } 40%, 80% { transform: rotate(-12deg); } }
@keyframes t-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.06, .92); } 45% { transform: translateY(-34px) scale(.96, 1.05); } 75% { transform: translateY(0) scale(1.04, .95); } }
@keyframes t-flap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-30deg); } }
@keyframes t-talk { from { transform: rotate(0); } to { transform: rotate(9deg); } }
@keyframes t-heart { 0% { opacity: 0; transform: translateY(10px) scale(.4); } 30% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-40px) scale(.9); } }
@keyframes t-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 15% { transform: scale(1.08, 1); } 45% { transform: scale(.62); opacity: .55; } 75% { transform: scale(1.05, 1); } }
@keyframes t-tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.tuki-idle:not(.tk-js) .t-body, .tuki-wave:not(.tk-js) .t-body, .tuki-talk:not(.tk-js) .t-body, .tuki-think:not(.tk-js) .t-body { animation: t-bob 3.2s ease-in-out infinite; }
.tuki-wave:not(.tk-js) .t-wing { animation: t-wave 1.4s ease-in-out 2; }
.tuki-happy:not(.tk-js) .t-all { animation: t-hop .75s cubic-bezier(.3, .7, .4, 1) 2; }
.tuki .t-shadow { transform-origin: 50% 50%; }
.tuki-happy:not(.tk-js) .t-shadow { animation: t-shadow .75s cubic-bezier(.3, .7, .4, 1) 2; }
.tuki-sad:not(.tk-js) .t-shadow { transform: scaleX(.9); }
.tuki-happy:not(.tk-js) .t-wing { animation: t-flap .25s ease-in-out 6; }
.tuki-happy:not(.tk-js) .t-heart { animation: t-heart 1.4s ease-out .2s 1 both; }
.tuki-talk:not(.tk-js) .t-beak-low { animation: t-talk .16s ease-in-out infinite alternate; }
.tuki-think:not(.tk-js) .t-head { animation: t-tilt 2.4s ease-in-out infinite; }
.tuki-think:not(.tk-js) .t-zz { opacity: 1; }
.tuki-sad:not(.tk-js) .t-all { transform: translateY(6px) rotate(-5deg); transition: transform .5s; }
.tuki-sad:not(.tk-js) .t-eye { animation: none; transform: scaleY(.62); }
.tuki-sad:not(.tk-js) .t-brow { transform: rotate(10deg); }
.tuki-sad:not(.tk-js) .t-wing { transform: rotate(8deg); }
.tuki-sad:not(.tk-js) .t-tear { animation: t-tear 1.8s ease-in .3s infinite; }
@keyframes t-tear { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(40px); } }
.tuki-btn { padding: 0; background: none; border-radius: 20px; }
.tuki-btn:active { transform: scale(.95); }
.hero .tuki-btn { flex: none; }
.empty .tuki, .result .tuki { margin: 0 auto 10px; display: block; }
.fb-tuki { margin: -6px 0 -6px -4px; }
.feedback { display: flex; gap: 10px; align-items: center; animation: slide-up .3s cubic-bezier(.2, .8, .2, 1); }

/* ——— Animaciones de la interfaz ——— */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes check-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.08, .95) rotate(-3deg); } 50% { transform: scale(.95, 1.07) rotate(2deg); } 75% { transform: scale(1.04) rotate(-1deg); } }
@keyframes tab-bounce { 0% { transform: scale(1); } 40% { transform: scale(.82); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes medal-in { 0% { opacity: 0; transform: scale(.2) rotate(-180deg); } 70% { transform: scale(1.15) rotate(10deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes fall { 0% { opacity: 1; transform: translate(0, -20px) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), 105vh) rotate(var(--r)); } }

.view.enter > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter > *:nth-child(2) { animation-delay: .03s; } .view.enter > *:nth-child(3) { animation-delay: .06s; }
.view.enter > *:nth-child(4) { animation-delay: .09s; } .view.enter > *:nth-child(5) { animation-delay: .12s; }
.view.enter > *:nth-child(6) { animation-delay: .15s; } .view.enter > *:nth-child(7) { animation-delay: .18s; }
.view.enter > *:nth-child(n+8) { animation-delay: .21s; }
.view.enter .group > .row { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter .group > .row:nth-child(2) { animation-delay: .04s; } .view.enter .group > .row:nth-child(3) { animation-delay: .08s; }
.view.enter .group > .row:nth-child(4) { animation-delay: .12s; } .view.enter .group > .row:nth-child(5) { animation-delay: .16s; }
.view.enter .group > .row:nth-child(n+6) { animation-delay: .2s; }
.view.enter .tiles > .tile { animation: pop-in .4s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter .tiles > .tile:nth-child(2) { animation-delay: .05s; } .view.enter .tiles > .tile:nth-child(3) { animation-delay: .1s; } .view.enter .tiles > .tile:nth-child(4) { animation-delay: .15s; }
.opts .opt { animation: rise .3s cubic-bezier(.2, .8, .2, 1) both; transition: transform .12s, border-color .2s, background .2s; }
.opts .opt:nth-child(2) { animation-delay: .05s; } .opts .opt:nth-child(3) { animation-delay: .1s; }
.opt:active, .chip:active, .tile:active { transform: scale(.97); }
.chip { transition: transform .12s, opacity .2s; }
.answer-zone .chip { animation: pop-in .22s ease-out; }
.pop { animation: pop .4s ease-out !important; }
.reveal { animation: pop .5s ease-out .15s !important; }
.pop-in { animation: pop-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.check.on { animation: check-pop .4s cubic-bezier(.2, .8, .2, 1) both; }
.flame { display: inline-flex; animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.flame svg { width: 22px; height: 22px; }
.tab.on svg { animation: tab-bounce .35s ease-out; }
.medal-big { display: inline-block; width: 46px; height: 46px; border-radius: 50%; margin-bottom: 6px; animation: medal-in .7s cubic-bezier(.2, .8, .2, 1) .3s both; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 6px 16px rgba(0, 0, 0, .15); }
.medal-big.m1 { background: var(--bronze); } .medal-big.m2 { background: var(--silver); } .medal-big.m3 { background: var(--gold); }
.progress > i { transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.week-bar { animation: grow .6s cubic-bezier(.2, .8, .2, 1) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 2s cubic-bezier(.25, .6, .4, 1) forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tuki-sad:not(.tk-js) .t-all { transform: none; }
}

.seg .seg-sub { display: block; font-size: 11px; font-weight: 400; color: var(--text-2); white-space: nowrap; }
/* Con seis niveles, en móviles estrechos solo se ve el código (el nombre ya aparece encima) */
@media (max-width: 520px) { .seg .seg-sub { display: none; } .seg button { padding: 8px 2px; min-width: 0; } }

/* Nube de texto de Tuki */
.tk-say { position: relative; background: var(--card); color: var(--text); border-radius: 16px; padding: 9px 13px; font-size: 15px; line-height: 1.35; font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.08); margin: 0 0 8px; text-wrap: pretty; }
.tk-say::before { content: ''; position: absolute; width: 14px; height: 14px; background: inherit; transform: rotate(45deg); border-radius: 3px; }
.tk-say.left { margin: 0 0 6px 6px; }
.tk-say.left::before, .feedback .tk-say::before { left: -6px; top: 14px; }
.tk-say.up { margin: 2px auto 12px; max-width: 320px; text-align: center; font-size: 17px; }
.tk-say.up::before { left: calc(50% - 7px); top: -6px; }
.feedback .tk-say { margin: 0 0 8px; font-size: 14.5px; }
.hero .tk-say { font-size: 16px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .tk-say { background: #2c2b28; box-shadow: 0 4px 14px rgba(0,0,0,.35); } }

/* Pestañas de las secciones de cada nivel (Aprender): todas a la vista, de igual ancho */
.ltabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: 18px; padding: 4px; background: var(--card); border: .5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.ltabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 8px 2px 7px; border-radius: 12px; color: var(--text-2); font-size: 12px; font-weight: 500; line-height: 1.15; transition: background .18s, color .18s, transform .12s; }
.ltabs button:active { transform: scale(.95); }
.ltabs button svg { width: 22px; height: 22px; }
.ltabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ltabs button em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 13px; }
.ltabs button.on { background: var(--tint-soft); color: var(--tint); font-weight: 600; }
.ltabs button.on em { color: var(--tint); }
.ltabs button:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; }
.ltab-panel { margin-top: 14px; min-height: 40vh; }
.ltab-panel .group { margin-top: 0; }
.tab-intro { font-size: 14px; line-height: 1.4; color: var(--text-2); margin: 0 4px 12px; }
.fade-in { animation: fade .22s ease-out; }
.ltab-panel .section-head.first { margin-top: 4px; }
.section-head .section-note { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }

/* Explicación detallada de un ejercicio */
.fx-more { display: inline-flex; margin-top: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.65); color: var(--text); font-size: 14px; font-weight: 600; border: .5px solid var(--line); }
.fx-more:active { transform: scale(.96); }
.why-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; font-size: 15px; margin-bottom: 14px; }
.why-head svg { width: 22px; height: 22px; flex: none; }
.why-head.ok { background: var(--ok-soft); color: var(--ok); }
.why-head.ko { background: var(--bad-soft); color: var(--bad); }
.why-head b { font-weight: 700; }
.why-sec { margin-top: 14px; }
.why-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 0 0 5px; font-weight: 600; }
.why-sec p { margin: 0; font-size: 16px; line-height: 1.45; }
.why-sent { font-size: 18px !important; }
.why-sent b { color: var(--tint); }
.why-q, .why-es { color: var(--text-2); font-size: 14.5px !important; margin-top: 3px !important; }
.why-tip { background: var(--fill); border-radius: 14px; padding: 12px 14px; }
.why-rule { margin-top: 14px; border-top: .5px solid var(--line); padding-top: 12px; }
.why-rule summary { font-weight: 600; color: var(--tint); cursor: pointer; font-size: 15px; }
.why-rule .item { margin-top: 10px; }
.why-rule .item h3 { font-size: 15px; margin: 0 0 2px; }
.why-rule .item p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--text-2); }

/* Shadowing: navegación entre frases y lo que se ha oído */
.shadow-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 12px; }
.sh-step { display: inline-flex; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 12px; color: var(--tint); font-size: 15px; font-weight: 600; background: var(--card); box-shadow: var(--shadow); }
.sh-step.next { flex-direction: row; }
.sh-step.next svg { transform: scaleX(-1); }
.sh-step:disabled { opacity: .35; }
.heard { color: var(--text-2); }
.feedback.mid { background: var(--accent-soft); color: var(--accent); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#to-rec { display: block; margin: 10px auto 0; }
.stt-offer { margin: 4px 0 14px; padding: 14px 16px; }
.stt-offer[hidden] { display: none; }

/* ——— Aprender: tarjetas de secciones ——— */
.lcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.lcard { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 10px; min-height: 168px; padding: 16px; border-radius: 22px; color: #fff;
  background: linear-gradient(140deg, var(--c1), var(--c2)); box-shadow: 0 10px 24px -12px var(--c2), 0 2px 6px rgba(0, 0, 0, .08);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s; -webkit-tap-highlight-color: transparent; }
.lcard.wide { grid-column: 1 / -1; min-height: 150px; }
.lcard::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .28), transparent 55%), radial-gradient(80% 70% at 0% 110%, rgba(0, 0, 0, .18), transparent 60%); }
.lcard:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px var(--c2), 0 2px 6px rgba(0, 0, 0, .08); }
.lcard:active { transform: scale(.97); }
.lcard:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
.lcard-ic { position: absolute; right: -14px; bottom: -18px; z-index: -1; color: rgba(255, 255, 255, .2); transform: rotate(-12deg); }
.lcard-ic svg { width: 112px; height: 112px; stroke-width: 1.6; }
.lcard-top { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.lcard-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--c2); font-size: 12px; font-weight: 700; }
.lcard-tag svg { width: 12px; height: 12px; }
.lcard-count { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .16); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lcard-body { margin-top: auto; }
.lcard-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.lcard-sub { margin-top: 3px; font-size: 13px; opacity: .92; line-height: 1.3; }
.lcard-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.lcard-bar i { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: #fff; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.lcard-next { font-size: 12.5px; font-weight: 600; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Historias: portadas en abanico */
.lc-historias { padding-right: 44%; }
.lcard-covers { position: absolute; right: 14px; top: 50%; width: 40%; height: 100px; transform: translateY(-50%); }
.lcard-covers .cover-thumb { position: absolute; top: 50%; right: 0; width: 72%; height: auto; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 2.5px solid rgba(255, 255, 255, .9); box-shadow: 0 8px 16px -6px rgba(0, 0, 0, .35); }
.lcard-covers .cover-thumb:nth-child(1) { z-index: 3; transform: translateY(-50%) rotate(4deg); right: 0; }
.lcard-covers .cover-thumb:nth-child(2) { z-index: 2; transform: translateY(-62%) rotate(-7deg); right: 22%; }
.lcard-covers .cover-thumb:nth-child(3) { z-index: 1; transform: translateY(-30%) rotate(-16deg); right: 38%; opacity: .9; }
.lcard:hover .lcard-covers .cover-thumb:nth-child(1) { transform: translateY(-54%) rotate(7deg); }
.lcard-covers .cover-thumb { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.lc-historias .lcard-ic { display: none; }
/* Entrada escalonada */
.view.enter .lcards > .lcard { animation: lcard-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter .lcards > .lcard:nth-child(2) { animation-delay: .05s; } .view.enter .lcards > .lcard:nth-child(3) { animation-delay: .1s; }
.view.enter .lcards > .lcard:nth-child(4) { animation-delay: .15s; } .view.enter .lcards > .lcard:nth-child(5) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { .lcard, .lcard-covers .cover-thumb { transition: none; } .view.enter .lcards > .lcard { animation: none; } }
@media (max-width: 360px) { .lcard-title { font-size: 19px; } .lc-historias { padding-right: 40%; } }
/* Cabecera de una sección */
.lhead { position: relative; overflow: hidden; isolation: isolate; padding: 20px 18px 18px; border-radius: 22px; color: #fff; background: linear-gradient(140deg, var(--c1), var(--c2)); box-shadow: 0 10px 24px -14px var(--c2); }
.lhead .lcard-ic svg { width: 120px; height: 120px; }
.lhead-lv { font-size: 13px; font-weight: 600; opacity: .9; }
.lhead-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 2px; }
.lhead-count { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .16); font-size: 13px; font-weight: 700; }
.lhead + .ltab-panel { margin-top: 16px; }
@keyframes lcard-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.lc-historias .lcard-count { margin-left: 0; }

/* ——— Vocabulario por temas ——— */
.vimg { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.vtopics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.vtopics > .vsec { grid-column: 1 / -1; font-size: 20px; font-weight: 700; margin: 14px 4px -2px; }
.vtopics > .vsec:first-child { margin-top: 0; }
.vtopic { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 150px; padding: 12px 14px 14px; border-radius: 20px; color: #fff;
  background: linear-gradient(145deg, var(--c1), var(--c2)); box-shadow: 0 10px 22px -14px var(--c2), 0 2px 6px rgba(0, 0, 0, .07); transition: transform .18s cubic-bezier(.2, .8, .2, 1); -webkit-tap-highlight-color: transparent; }
.vtopic::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 70% at 85% 10%, rgba(255, 255, 255, .35), transparent 60%); }
.vtopic:hover { transform: translateY(-2px); } .vtopic:active { transform: scale(.96); }
.vtopic:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
.vtopic-img { align-self: flex-end; width: 64px; margin: -4px -4px auto 0; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .22)); transform: rotate(8deg); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.vtopic:hover .vtopic-img { transform: rotate(0) scale(1.08); }
.vtopic-title { margin-top: 6px; font-size: 17px; hyphens: manual; -webkit-hyphens: manual; overflow-wrap: break-word; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; max-width: 100%; text-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.vtopic-sub { font-size: 12.5px; font-weight: 600; opacity: .92; margin-bottom: 4px; }
.vtopic .lcard-bar { height: 5px; }
.view.enter .vtopics > .vtopic { animation: lcard-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter .vtopics > .vtopic:nth-child(n+3) { animation-delay: .06s; } .view.enter .vtopics > .vtopic:nth-child(n+5) { animation-delay: .12s; } .view.enter .vtopics > .vtopic:nth-child(n+7) { animation-delay: .18s; }
.vhead { padding-right: 130px; min-height: 120px; }
.vhead-img { position: absolute; right: 14px; top: 50%; width: 104px; transform: translateY(-50%) rotate(6deg); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .25)); }
.vhint { margin: 14px 2px 10px; font-size: 14px; color: var(--text-2); }
.vwords { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.vword { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: .5px solid var(--line); text-align: center; color: var(--text); transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.vword .vimg { width: 64px; margin-bottom: 6px; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.vword b { font-size: 15px; font-weight: 700; line-height: 1.15; }
.vword span { font-size: 12.5px; color: var(--text-2); line-height: 1.2; }
.vword:active { transform: scale(.95); }
.vword.tap .vimg { animation: vtap .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes vtap { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-6deg); } 70% { transform: scale(.95) rotate(3deg); } 100% { transform: scale(1); } }
.vword-ok { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; background: var(--tint); color: #fff; display: grid; place-items: center; }
.vword-ok svg { width: 12px; height: 12px; }
/* Ejercicios con imagen */
.vq-img { width: 150px; margin: 6px auto 12px; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .16)); animation: vtap .6s cubic-bezier(.2, .8, .2, 1); }
.vq-es { text-align: center; }
.vq-hint { text-align: center; font: 700 22px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; color: var(--text-2); margin: 4px 0 12px; }
.vq-say { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 16px; }
.vq-word { margin: 0; }
.vq-play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); transition: transform .12s; }
.vq-play svg { width: 24px; height: 24px; }
.vq-play.big { width: 88px; height: 88px; } .vq-play.big svg { width: 40px; height: 40px; }
.vq-play:active { transform: scale(.92); }
.vopts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt.vopt { padding: 14px; display: grid; place-items: center; }
.opt.vopt .vimg { width: min(100px, 70%); }
/* Tarjetas que giran */
.flip { display: block; width: 100%; max-width: 360px; height: 340px; margin: 10px auto 18px; perspective: 1200px; -webkit-tap-highlight-color: transparent; }
.flip-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .45); }
.flip-front { background: linear-gradient(145deg, var(--c1), var(--c2)); color: #fff; }
.flip-front .vimg { width: 170px; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .25)); }
.flip-front em { font-style: normal; font-weight: 600; font-size: 15px; opacity: .95; }
.flip-back { background: var(--card); border: .5px solid var(--line); color: var(--text); transform: rotateY(180deg); }
.flip-back .vimg { width: 96px; }
.flip-back b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.flip-back > span { font-size: 17px; color: var(--text-2); }
.flip-say { position: absolute; top: 14px; right: 14px; color: var(--tint); } .flip-say svg { width: 24px; height: 24px; }
/* Memoria */
.mem { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
@media (min-width: 560px) { .mem { grid-template-columns: repeat(4, 1fr); } }
.mem-card { aspect-ratio: 3 / 4; perspective: 800px; -webkit-tap-highlight-color: transparent; }
.mem-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); }
.mem-card.on .mem-in { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .5); padding: 8px; }
.mem-back { background: linear-gradient(145deg, var(--c1), var(--c2)); color: rgba(255, 255, 255, .85); font-size: 34px; font-weight: 900; }
.mem-front { background: var(--card); border: .5px solid var(--line); transform: rotateY(180deg); color: var(--text); text-align: center; }
.mem-front .vimg { width: 78%; }
.mem-front b { font-size: 15px; font-weight: 700; line-height: 1.15; word-break: break-word; }
.mem-card.done .mem-front { background: var(--tint-soft); border-color: var(--tint); animation: vtap .5s; }
.mem-card.shake .mem-front { border-color: #d9483b; }
@media (prefers-reduced-motion: reduce) { .flip-in, .mem-in, .vtopic, .vtopic-img { transition: none; } .vword.tap .vimg, .vq-img { animation: none; } }
.vall { margin-top: 14px; }
.vall svg { width: 18px; height: 18px; }
.vsearch { margin: 4px 0 14px; }
/* ——— Verbos por tipo ——— */
.vverbs { display: grid; gap: 10px; }
@media (min-width: 620px) { .vverbs { grid-template-columns: 1fr 1fr; } }
.vverb { position: relative; background: var(--card); border: .5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.vverb-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 8px; text-align: left; color: var(--text); -webkit-tap-highlight-color: transparent; }
.vverb-main .vimg { width: 52px; flex: none; transition: transform .25s; }
.vverb-main.tap .vimg { animation: vtap .5s cubic-bezier(.2, .8, .2, 1); }
.vverb-txt { display: flex; flex-direction: column; min-width: 0; }
.vverb-txt b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.vverb-es { font-size: 14px; color: var(--text-2); }
.vverb-forms { margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--tint); }
.vverb-ex { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 9px 44px 11px 14px; border-top: .5px solid var(--line); background: var(--fill); text-align: left; color: var(--text); position: relative; font-size: 14.5px; line-height: 1.35; }
.vverb-ex b { color: var(--tint); }
.vverb-ex em { font-style: normal; font-size: 13px; color: var(--text-2); }
.vverb-ex svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--tint); }
.vverb-ex.tap { animation: pop .3s; }
.vverb .vword-ok { top: 10px; right: 10px; }
.flip-forms { font-size: 15px !important; font-weight: 700; color: var(--tint) !important; }
.flip-ex { font-size: 14px !important; color: var(--text) !important; padding: 0 18px; text-align: center; line-height: 1.35; }
.flip-ex b { color: var(--tint); }
.flip-ex b { font-size: inherit !important; font-weight: 700; letter-spacing: 0; }
.vemo { display: grid; place-items: center; aspect-ratio: 1; line-height: 1; font-size: 3.2em; }
.vq-img .vemo, .flip-front .vemo { font-size: 110px; }

/* ——— Misiones ——— */
.lc-misiones { padding-right: 46%; }
.lc-misiones .lcard-ic { display: none; }
.lcard-bubbles { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 42%; display: flex; flex-direction: column; gap: 6px; }
.lcard-bubbles span { align-self: flex-start; max-width: 100%; padding: 7px 11px; border-radius: 14px 14px 14px 4px; background: rgba(255, 255, 255, .95); color: #2c2350; font-size: 12px; font-weight: 600; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .4); transform: rotate(-2deg); }
.lcard-bubbles span + span { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #2fd3a4; color: #06332a; transform: rotate(2deg); }
.mrow-img { width: 40px; flex: none; } .mrow-img .vimg { width: 40px; }
.mstars { color: #f2b11f; letter-spacing: 1px; font-size: 15px; }
.mscene { margin: 16px 2px 4px; font-size: 16px; line-height: 1.45; color: var(--text); }
.mgoal-n { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); font-weight: 700; font-size: 14px; }
.mgoal-n svg { width: 14px; height: 14px; } .mgoal-n.ok { background: var(--tint); color: #fff; } .mgoal-n.ko { background: var(--fill); color: var(--text-2); }
.row-ic { color: var(--tint); flex: none; display: inline-flex; } .row-ic svg { width: 20px; height: 20px; }
/* Chat */
body.mchat-on .view { padding-bottom: 150px; }
.mgoals { position: sticky; top: calc(56px + var(--safe-t)); z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 10px; background: var(--bg); }
.mg { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card); border: .5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); transition: background .3s, color .3s; }
.mg i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); font-size: 11px; }
.mg svg { width: 14px; height: 14px; } .mg.ok { background: var(--tint); color: #fff; border-color: var(--tint); animation: pop .4s; }
.mvoice { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--tint); border: .5px solid var(--line); }
.mvoice svg { width: 18px; height: 18px; }
.mlog { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.mwho { align-self: center; font-size: 12px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.mmsg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; animation: lcard-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.mmsg.ai { align-self: flex-start; } .mmsg.me { align-self: flex-end; }
.mav { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--card); border: .5px solid var(--line); display: grid; place-items: center; padding: 4px; }
.mav .vimg, .mav .vemo { width: 24px; font-size: 20px; }
.mtxt { position: relative; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.4; }
.mmsg.ai .mtxt { background: var(--card); color: var(--text); border: .5px solid var(--line); border-bottom-left-radius: 6px; padding-right: 40px; }
.mmsg.me .mtxt { background: var(--tint); color: #fff; border-bottom-right-radius: 6px; }
.mplay { position: absolute; right: 8px; bottom: 6px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--tint); }
.mplay svg { width: 18px; height: 18px; }
.mtyping .mtxt { display: flex; gap: 4px; padding: 14px 16px; }
.mtyping i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: mdot 1s infinite; } .mtyping i:nth-child(2) { animation-delay: .15s; } .mtyping i:nth-child(3) { animation-delay: .3s; }
@keyframes mdot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.mdock .dock-inner { display: flex; flex-direction: column; gap: 8px; }
.mtools { display: flex; align-items: center; gap: 8px; }
.mtool { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--tint); font-size: 14px; font-weight: 600; }
.mtool svg { width: 16px; height: 16px; } .mtool:disabled { opacity: .4; }
.mleft { margin: 0 auto; font-size: 13px; color: var(--text-2); font-weight: 600; }
.mbar { display: flex; align-items: center; gap: 8px; }
.minput { flex: 1; margin: 0; height: 46px; border-radius: 23px; padding: 0 16px; }
.mmic, .msend { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--tint); transition: transform .12s, background .2s; }
.msend { background: var(--tint); color: #fff; } .msend:disabled { opacity: .35; }
.mmic svg, .msend svg { width: 22px; height: 22px; }
.mmic.on { background: #d9483b; color: #fff; animation: mpulse 1.2s infinite; }
@keyframes mpulse { 0% { box-shadow: 0 0 0 0 rgba(217, 72, 59, .5); } 70% { box-shadow: 0 0 0 12px rgba(217, 72, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 72, 59, 0); } }
.mmic:active, .msend:active { transform: scale(.92); }
/* Informe */
.mreport { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 16px; }
.pl-chip { display: inline-block; margin: 0 0 8px; padding: 2px 9px; border-radius: 99px; background: var(--tint); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.mintro { display: flex; align-items: flex-end; gap: 4px; margin: 4px 0 14px; }
.mintro > div:last-child { flex: 1; }
.mtuki { position: relative; max-width: 330px; padding: 12px 16px; border-radius: 18px; background: var(--card); border: .5px solid var(--line); box-shadow: var(--shadow); text-align: center; font-weight: 600; line-height: 1.4; }
.mrstars { font-size: 38px; letter-spacing: 6px; color: var(--fill); } .mrstars .on { color: #f2b11f; text-shadow: 0 2px 8px rgba(242, 177, 31, .45); }
.mcorr { background: var(--card); border: .5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.mcorr-you { color: #c2402f; text-decoration: line-through; text-decoration-thickness: 1.5px; font-size: 15px; }
.mcorr-better { position: relative; color: var(--tint); font-weight: 700; font-size: 16px; margin-top: 3px; padding-right: 32px; }
.mcorr-better .mplay { bottom: -4px; right: -4px; }
.mcorr-why { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.mph { text-align: left; color: var(--text); }
.add-dot.on { background: var(--tint); color: #fff; }

/* Reproductor de historias por frases */
.sp-dock { padding-top: 10px; }
body.sp-on .view { padding-bottom: calc(160px + var(--safe-b)); }
.sp-bar { display: flex; gap: 3px; height: 28px; align-items: center; margin: -6px 0 0; }
.sp-seg { flex: 1; min-width: 0; height: 40px; padding: 18px 0; background: none; border: 0; cursor: pointer; }
.sp-seg i { display: block; height: 4px; border-radius: 2px; background: var(--tint); width: 0; transition: width .2s linear; }
.sp-seg { background: linear-gradient(var(--line), var(--line)) center / 100% 4px no-repeat; border-radius: 2px; }
.sp-seg.on { background-image: linear-gradient(color-mix(in srgb, var(--tint) 30%, transparent), color-mix(in srgb, var(--tint) 30%, transparent)); }
.sp-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.sp-rec { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.sp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; background: var(--fill); color: var(--text); font-size: 12.5px; font-weight: 600; border: 0; }
.sp-score { font-size: 12.5px; font-weight: 700; color: var(--bad); } .sp-score.good { color: var(--ok); } .sp-score.muted { color: var(--text-3); font-weight: 500; }
.sp-pos { flex: none; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-ctl { display: flex; align-items: center; justify-content: center; gap: 6px; }
.story-line .w.ok { color: var(--ok); } .story-line .w.miss { color: var(--bad); text-decoration: underline dotted; text-underline-offset: 3px; }
.sp-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: none; border: 0; }
.sp-btn svg { width: 22px; height: 22px; }
.sp-btn.on { color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); }
.sp-main { width: 54px; height: 54px; background: var(--tint); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--tint) 35%, transparent); }
.sp-main svg { width: 26px; height: 26px; }
.sp-btn.rec { color: #fff; background: var(--bad); animation: sp-pulse 1.2s infinite; }
@keyframes sp-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--bad) 25%, transparent); } }
.sp-rate { font-size: 13px; font-weight: 700; width: 46px; border-radius: 12px; }
.story-line { cursor: pointer; }

/* ——— Temas de color (se compran con semillas en Perfil › Temas) ——— */
:root[data-theme="selva"] { --bg: #eef4ea; --bg-2: #e2ecdc; --card: #ffffff; --bar: rgba(238, 244, 234, 0.82); --tint: #2f7d32; --tint-soft: rgba(47, 125, 50, 0.12); --accent: #d9822b; --accent-soft: rgba(217, 130, 43, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="selva"] { --bg: #0f1a12; --bg-2: #152218; --card: #1a2a1d; --bar: rgba(15, 26, 18, 0.8); --tint: #5cc46a; --tint-soft: rgba(92, 196, 106, 0.16); --accent: #f0a04b; --accent-soft: rgba(240, 160, 75, 0.16); } }
:root[data-theme="oceano"] { --bg: #edf3f8; --bg-2: #e0eaf2; --card: #ffffff; --bar: rgba(237, 243, 248, 0.82); --tint: #1f6fb2; --tint-soft: rgba(31, 111, 178, 0.12); --accent: #f0a43a; --accent-soft: rgba(240, 164, 58, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="oceano"] { --bg: #0d1520; --bg-2: #121d2b; --card: #172536; --bar: rgba(13, 21, 32, 0.8); --tint: #4ea3f0; --tint-soft: rgba(78, 163, 240, 0.16); --accent: #f5b75a; --accent-soft: rgba(245, 183, 90, 0.16); } }
:root[data-theme="atardecer"] { --bg: #fbf0ea; --bg-2: #f4e2d9; --card: #ffffff; --bar: rgba(251, 240, 234, 0.82); --tint: #df5236; --tint-soft: rgba(223, 82, 54, 0.12); --accent: #8b5cd6; --accent-soft: rgba(139, 92, 214, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="atardecer"] { --bg: #1c1210; --bg-2: #251814; --card: #2b1c17; --bar: rgba(28, 18, 16, 0.8); --tint: #ff7a59; --tint-soft: rgba(255, 122, 89, 0.16); --accent: #b48cf2; --accent-soft: rgba(180, 140, 242, 0.16); } }
:root[data-theme="lavanda"] { --bg: #f4f1fa; --bg-2: #eae4f5; --card: #ffffff; --bar: rgba(244, 241, 250, 0.82); --tint: #7b4fc9; --tint-soft: rgba(123, 79, 201, 0.12); --accent: #e0567a; --accent-soft: rgba(224, 86, 122, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="lavanda"] { --bg: #15121d; --bg-2: #1c1827; --card: #221d30; --bar: rgba(21, 18, 29, 0.8); --tint: #a98bf0; --tint-soft: rgba(169, 139, 240, 0.16); --accent: #ff7fa0; --accent-soft: rgba(255, 127, 160, 0.16); } }
:root[data-theme="sakura"] { --bg: #fcf0f3; --bg-2: #f6e2e8; --card: #ffffff; --bar: rgba(252, 240, 243, 0.82); --tint: #d6457a; --tint-soft: rgba(214, 69, 122, 0.12); --accent: #2f9a6d; --accent-soft: rgba(47, 154, 109, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="sakura"] { --bg: #1d1216; --bg-2: #26171d; --card: #2c1b22; --bar: rgba(29, 18, 22, 0.8); --tint: #ff79a8; --tint-soft: rgba(255, 121, 168, 0.16); --accent: #4fc58f; --accent-soft: rgba(79, 197, 143, 0.16); } }
:root[data-theme="cafe"] { --bg: #f5eee4; --bg-2: #ebe1d3; --card: #fffdf9; --bar: rgba(245, 238, 228, 0.82); --tint: #8a5a35; --tint-soft: rgba(138, 90, 53, 0.12); --accent: #2f9a5d; --accent-soft: rgba(47, 154, 93, 0.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="cafe"] { --bg: #17120e; --bg-2: #1f1813; --card: #261e17; --bar: rgba(23, 18, 14, 0.8); --tint: #d39b6a; --tint-soft: rgba(211, 155, 106, 0.16); --accent: #5cc48a; --accent-soft: rgba(92, 196, 138, 0.16); } }
:root[data-theme="medianoche"] { color-scheme: dark; --bg: #0b1020; --bg-2: #10172b; --card: #161f38; --text: #eef1fa; --text-2: #a3abc4; --text-3: #69728d;
  --line: rgba(255, 255, 255, .09); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .12); --bar: rgba(11, 16, 32, .82);
  --tint: #f5c542; --tint-soft: rgba(245, 197, 66, .15); --accent: #6fa8ff; --accent-soft: rgba(111, 168, 255, .16); --shadow: none; }
:root[data-theme="medianoche"] body { background-image: radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55) 50%, transparent 51%), radial-gradient(1px 1px at 72% 9%, rgba(255,255,255,.4) 50%, transparent 51%), radial-gradient(1.5px 1.5px at 40% 62%, rgba(255,255,255,.35) 50%, transparent 51%), radial-gradient(1px 1px at 88% 44%, rgba(255,255,255,.5) 50%, transparent 51%), radial-gradient(1px 1px at 22% 82%, rgba(255,255,255,.4) 50%, transparent 51%); background-attachment: fixed; }
:root[data-theme="medianoche"] .seg button.on { background: #24304f; }
:root[data-theme="medianoche"] .tk-say { background: #1d2846; }

/* ——— Pistas con semillas ——— */
.hint-btn { display: inline-flex; align-items: center; gap: 6px; margin: 16px auto 0; padding: 8px 14px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 15px; font-weight: 600; }
.hint-btn { display: flex; width: max-content; }
.hint-btn svg { width: 18px; height: 18px; }
.hint-btn:disabled { opacity: .45; }
.hint-cost { display: inline-flex; align-items: center; gap: 1px; color: var(--ok); font-variant-numeric: tabular-nums; }
.hint-cost svg { width: 14px; height: 14px; }
.opt.gone { opacity: .25; text-decoration: line-through; pointer-events: none; }
.vopt.gone { filter: grayscale(1); }
.mtool .seed-ic { width: 13px; height: 13px; display: inline-block; vertical-align: -1px; color: var(--ok); }

/* ——— Candados de nivel ——— */
.seg-lock { display: inline-flex; vertical-align: -1px; margin-right: 2px; color: var(--text-3); }
.seg-lock svg { width: 11px; height: 11px; }
.lock-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 14px 0 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.lock-banner > svg:first-child { width: 22px; height: 22px; color: var(--accent); flex: none; }
.lock-banner div { flex: 1; display: grid; gap: 2px; }
.lock-banner span { font-size: 13px; color: var(--text-2); }
.lock-chip { display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.lock-chip svg { width: 13px; height: 13px; }
.lock-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.lock-head .tuki { flex: none; }
.seed-balance { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 12px; color: var(--ok); font-size: 15px; }
.seed-balance svg { width: 18px; height: 18px; }
.seed-balance b { color: var(--text); font-size: 18px; }

/* ——— Tienda de temas ——— */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-card { display: grid; gap: 3px; text-align: left; padding: 10px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); border: 2px solid transparent; }
.theme-card.on { border-color: var(--tint); }
.theme-prev { position: relative; height: 74px; border-radius: 10px; background: var(--t0); overflow: hidden; margin-bottom: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.theme-prev i { position: absolute; left: 10px; top: 12px; width: 52%; height: 12px; border-radius: 6px; background: var(--t1); }
.theme-prev b { position: absolute; left: 10px; top: 32px; width: 34%; height: 9px; border-radius: 5px; background: var(--t1); opacity: .45; }
.theme-prev em { position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--t2); }
.theme-name { font-weight: 700; font-size: 16px; }
.theme-sub { font-size: 12px; color: var(--text-2); min-height: 30px; }
.theme-price { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--tint); }
.theme-price svg { width: 14px; height: 14px; color: var(--ok); }

/* ——— La selva ——— */
.jimg { display: block; user-select: none; -webkit-user-drag: none; }
.jimg.ci { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; }
.jimg.jrow { width: 34px; height: 34px; flex: none; }
.jimg.jbig { width: 64px; height: 64px; flex: none; }
.jhud { display: flex; gap: 8px; margin: 4px 0 12px; }
.jchip { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--text); min-width: 0; }
.jchip > svg, .jchip > .jimg { grid-row: 1 / 3; width: 26px; height: 26px; }
.jchip.seeds > svg { color: var(--ok); }
.jchip b { font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.jchip small { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jweather, .jevent, .jchest { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; margin-bottom: 10px; background: var(--fill); width: 100%; text-align: left; }
.jweather .jimg, .jevent .jimg, .jchest .jimg { width: 36px; height: 36px; flex: none; }
.jweather div, .jevent span, .jchest div { flex: 1; display: grid; gap: 1px; font-size: 13px; color: var(--text-2); }
.jweather b, .jchest b { color: var(--text); font-size: 15px; }
.jweather.rain { background: rgba(59, 130, 214, .14); }
.jweather.water { background: var(--tint-soft); }
.jweather.dry { background: var(--accent-soft); }
.jweather a { font-weight: 600; font-size: 14px; padding: 12px 8px; margin: -12px -8px; } /* zona táctil de 44 px */
.jchest { background: linear-gradient(135deg, rgba(224, 172, 46, .25), rgba(242, 138, 31, .18)); animation: jpulse 2s ease-in-out infinite; }
@keyframes jpulse { 50% { transform: scale(1.02); } }
.jboard { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.18), transparent 40%), linear-gradient(180deg, #7cc46b, #4f9a46 60%, #3d7f37); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08); }
.jdecor { display: contents; } /* los adornos no ocupan casilla en la cuadrícula */
.jdecor .jimg { position: absolute; width: 34px; height: 34px; opacity: .9; pointer-events: none; }
.jdecor .d1 { left: -6px; top: -4px; transform: rotate(-20deg); } .jdecor .d2 { right: -4px; top: 30%; transform: rotate(30deg); }
.jdecor .d3 { left: 2px; bottom: 4px; width: 26px; height: 26px; } .jdecor .d4 { right: 8px; bottom: -2px; width: 24px; height: 24px; }
.jdecor .d5 { left: 45%; top: -2px; width: 22px; height: 22px; animation: jfly 6s ease-in-out infinite; }
.jdecor .an { width: 40px; height: 40px; z-index: 2; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); animation: jbob 3s ease-in-out infinite; }
.jdecor .an0 { left: 4px; top: 38%; } .jdecor .an1 { right: 2px; top: 8%; animation-delay: .5s; } .jdecor .an2 { right: 30%; bottom: 0; animation-delay: 1s; }
.jdecor .an3 { left: 30%; top: 1%; animation-delay: 1.5s; } .jdecor .an4 { left: 2px; bottom: 20%; animation-delay: 2s; } .jdecor .an5 { right: 2px; bottom: 30%; animation-delay: .8s; } .jdecor .an6 { left: 50%; bottom: 40%; animation-delay: 1.2s; }
@keyframes jbob { 50% { transform: translateY(-4px); } }
@keyframes jfly { 50% { transform: translate(30px, 8px) rotate(10deg); } }
.jplot { position: relative; z-index: 1; aspect-ratio: 1 / 1.08; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px 4px 8px; border-radius: 16px; background: rgba(255, 255, 255, .14); color: #fff; }
.jplot small { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.35); line-height: 1.15; text-align: center; }
.jsoil { position: absolute; left: 14%; right: 14%; bottom: 22%; height: 20%; border-radius: 50%; background: radial-gradient(ellipse at center, #8a5a35 0, #6d4425 70%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.jplot .jtree { position: relative; width: 72%; height: auto; margin-bottom: 8px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25)); transition: transform .2s; }
.jplot .jtree.small { width: 46%; }
.jplot.ready .jtree { animation: jsway 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes jsway { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.jplot:active .jtree { transform: scale(.94); }
.jfruits { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 2px; padding: 2px 7px 2px 3px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1d1c1a; font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.jfruits .jimg { width: 20px; height: 20px; }
.jplot.full .jfruits { background: #ffd54a; animation: jpulse 1.2s ease-in-out infinite; }
.jlv { position: absolute; top: 6px; left: 8px; font-size: 10px; color: #ffe27a; text-shadow: 0 1px 2px rgba(0,0,0,.4); letter-spacing: -1px; }
.jbar { position: relative; width: 80%; height: 5px; border-radius: 3px; background: rgba(0,0,0,.22); overflow: hidden; margin-bottom: 4px; }
.jbar i { position: absolute; inset: 0 auto 0 0; background: #ffe27a; border-radius: 3px; transition: width .9s linear; }
.jplot.empty { background: rgba(0, 0, 0, .1); border: 2px dashed rgba(255,255,255,.4); justify-content: center; }
.jplot.empty .jsoil { opacity: .6; }
.jplus { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: #2f7d32; margin-bottom: 6px; }
.jplus svg { width: 20px; height: 20px; }
.jexpand { background: rgba(0,0,0,.18); justify-content: center; gap: 6px; }
.jexpand > span svg { width: 26px; height: 26px; }
.jfloat { position: fixed; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 20px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.45); pointer-events: none; animation: jfloat .9s ease-out forwards; }
.jfloat .jimg { width: 28px; height: 28px; }
@keyframes jfloat { to { transform: translate(-50%, -70px); opacity: 0; } }
.tk-row { display: flex; gap: 8px; align-items: center; margin: 14px 0 0; }
.tk-row .tuki { flex: none; }
.tk-row .tk-say { flex: 1; }
.tk-row .tk-say::before { left: -6px; top: calc(50% - 7px); } /* el piquito apunta a Tuki, no tapa el texto */
.jorder { padding: 12px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); display: grid; gap: 10px; }
.jorder.done { opacity: .7; }
.jorder-head { display: flex; gap: 10px; align-items: center; }
.jorder-head .jimg { width: 40px; height: 40px; }
.jorder-head div { display: grid; font-size: 13px; color: var(--text-2); }
.jorder-head b { font-size: 15px; color: var(--text); }
.jorder-items { display: flex; flex-wrap: wrap; gap: 8px; }
.jorder-items span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--fill); font-weight: 600; font-variant-numeric: tabular-nums; }
.jorder-items span.ok { background: var(--ok-soft); color: var(--ok); }
.jorder-items .jimg { width: 24px; height: 24px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border-radius: 999px; background: var(--tint-soft); color: var(--tint); font-weight: 600; font-size: 14px; flex: none; white-space: nowrap; }
.pill:disabled { opacity: .4; }
.pill svg { width: 14px; height: 14px; color: var(--ok); }
.jtrend { font-size: 12px; font-weight: 600; color: var(--text-3); }
.jtrend.up { color: var(--ok); } .jtrend.down { color: var(--bad); }
.jtree-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.jqty { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 8px; }
.jqty b { min-width: 48px; text-align: center; font-size: 26px; font-variant-numeric: tabular-nums; }
.jhow .row-sub svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; color: var(--ok); }
.nav-link { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; }
.nav-link svg { width: 24px; height: 24px; color: var(--tint); }
.rk-row.me { background: var(--tint-soft); }
.rk-pos { width: 34px; flex: none; text-align: center; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rk-c { font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 3px; }
.rk-gap { min-height: 30px; padding: 2px; color: var(--text-3); }
.jtrophies { display: flex; flex-wrap: wrap; gap: 10px; }
.jtrophies span { display: grid; justify-items: center; font-size: 11px; color: var(--text-2); }
.jtrophies .jimg { width: 40px; height: 40px; }

/* Huerto: pedido en inglés, pregunta del mercado, racha del cofre, colección, logros y fruta volando */
.jsay { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 14px; background: var(--fill); }
.jspk { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--tint-soft); color: var(--tint); vertical-align: middle; }
.jspk svg { width: 18px; height: 18px; }
.jsay-txt { flex: 1; display: grid; gap: 3px; text-align: left; background: none; padding: 0; }
.jsay-txt b { font-size: 15px; color: var(--text); line-height: 1.3; }
.jsay-txt span { font-size: 14px; color: var(--text); }
.jsay-txt small { font-size: 12px; color: var(--text-3); }
.jquiz { margin: 4px 0 6px; padding: 12px; border-radius: 14px; background: var(--fill); }
.jquiz-q { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.jquiz p { margin: 6px 0 10px; font-size: 15px; }
.jquiz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.jquiz-opts .pill.ok { background: var(--ok-soft); color: var(--ok); opacity: 1; }
.jquiz-opts .pill.bad { background: rgba(220, 60, 60, .14); color: var(--bad); opacity: 1; }
.jquiz-res { margin: 10px 0 0 !important; font-size: 14px !important; font-weight: 600; }
.jquiz-res.ok { color: var(--ok); } .jquiz-res.bad { color: var(--text-2); }
.jquiz-res span { display: block; font-weight: 400; color: var(--text-2); margin-top: 2px; }
.jdots { display: flex !important; gap: 5px; margin-top: 4px; }
.jdots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(128, 128, 128, .3); } /* visible también en modo oscuro */
.jdots i.on { background: #e0ac2e; }
.jdots i.now { background: #f28a1f; box-shadow: 0 0 0 3px rgba(242, 138, 31, .3); }
.jdots i:last-child { width: 13px; height: 13px; margin-top: -2px; }
.jseason { background: linear-gradient(135deg, rgba(47, 143, 58, .18), rgba(214, 72, 59, .14)); }
.jcoll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jcoll span { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.jcoll .jimg { width: 36px; height: 36px; filter: grayscale(1) brightness(.6); opacity: .35; }
.jcoll span.on .jimg { filter: none; opacity: 1; }
.jcoll small { font-size: 11px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jlocked .jimg { filter: grayscale(1); opacity: .45; }
.jfly { position: fixed; z-index: 61; pointer-events: none; }
.jfly .jimg { width: 30px; height: 30px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }

/* ——— Premium ——— */
.lock-chip.pro { background: linear-gradient(135deg, #f2b33d, #f28a1f); color: #fff; }
.vtopic-pro { position: absolute; top: 10px; left: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .32); color: #fff; font-size: 11.5px; font-weight: 700; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.vtopic-pro svg { width: 11px; height: 11px; }
.pro-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 14px; }
.pro-perks { margin-bottom: 14px; }
.pro-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.pro-plan { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 14px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: 2px solid var(--line); text-align: left; transition: transform .15s; }
.pro-plan:active { transform: scale(.97); }
.pro-plan.best { border-color: var(--tint); background: linear-gradient(180deg, var(--tint-soft), var(--card) 70%); }
.pro-tag { position: absolute; top: -10px; right: 12px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 9px; }
.pro-name { font-weight: 700; font-size: 16px; }
.pro-price { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.pro-price small { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pro-note { font-size: 13px; color: var(--text-2); }
.pro-fine { margin: 6px 4px 0; line-height: 1.5; }
@media (max-width: 360px) { .pro-plans { grid-template-columns: 1fr; } }

/* Enlaces legales del pie: zona táctil cómoda */
.legal-foot a { display: inline-block; padding: 10px 3px; }

/* ——— Transiciones entre pantallas, como en iOS ——— */
.view.push { animation: view-push .36s cubic-bezier(.2, .9, .25, 1) backwards; }
.view.pop { animation: view-pop .32s cubic-bezier(.2, .9, .25, 1) backwards; }
@keyframes view-push { from { transform: translateX(34%); opacity: .3; } }
@keyframes view-pop { from { transform: translateX(-22%); opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .view.push, .view.pop { animation: none; } }
/* Actividades a pantalla completa: sin barra de pestañas */
body.focus .tabbar { display: none; }
body.focus .view { padding-bottom: calc(40px + var(--safe-b)); }
/* Portadas: aparecen suavemente sobre su degradado */
.story-cover img, .cover-thumb img { opacity: 0; transition: opacity .35s ease; }
.story-cover img.ld, .cover-thumb img.ld { opacity: 1; }
/* Reproductor de historias compacto al bajar */
.sp-dock .sp-info, .sp-dock .sp-bar { transition: max-height .25s ease, opacity .2s ease, margin .25s ease; max-height: 44px; overflow: hidden; }
.sp-dock.mini { padding-top: 6px; }
.sp-dock.mini .sp-info, .sp-dock.mini .sp-bar { max-height: 0; opacity: 0; margin: 0; }
.sp-dock.mini .sp-btn { width: 36px; height: 36px; }
/* Fallos en la pantalla de resultados */
.miss { text-align: left; margin-top: 18px; }
.miss .btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.miss .btn svg { width: 18px; height: 18px; }
.miss-spk { width: 18px; height: 18px; color: var(--tint); flex: none; }
/* Botón de escuchar pequeño en Escribe y Completa */
.vq-play.small { width: 40px; height: 40px; margin: 6px auto 0; }
.vq-play.small svg { width: 20px; height: 20px; }
.vq-play.inline { display: inline-grid; vertical-align: middle; margin: -4px 0 0 4px; width: 34px; height: 34px; }

/* Analizar palabra */
.wa-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.wa-btns .btn:only-child { grid-column: 1 / -1; }
.wa-btns .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }
.wa-btns .btn svg { width: 18px; height: 18px; }
.wa-head { display: flex; align-items: center; gap: 12px; }
.wa-head > div { flex: 1; }
.wa-sec { margin-top: 18px; }
.wa-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: 600; margin: 0 0 8px; }
.wa-sec p { margin: 0 0 8px; line-height: 1.45; }
.wa-base { color: var(--tint); cursor: pointer; }
.wa-note { font-size: 14px; color: var(--text-2); }
.wa-forms { display: grid; gap: 6px; background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); margin: 6px 0 10px; }
.wa-forms > span { font-size: 12px; color: var(--text-2); }
.wa-forms b { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; font-size: 17px; }
.wa-forms i { font-style: normal; display: grid; }
.wa-forms small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.wa-ex { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); margin-bottom: 8px; }
.wa-ex p { margin: 0; font-size: 16px; }
.wa-ex p b { color: var(--tint); }
.wa-ex .es { font-size: 14px; color: var(--text-2); margin-top: 3px; }
.wa-ex small { display: block; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.wa-spk { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); }
.wa-spk svg { width: 18px; height: 18px; }

/* Aviso discreto «Sin conexión» */
.net-pill { position: fixed; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 999px; background: rgba(60, 60, 67, .86); color: #fff; font-size: 13px; font-weight: 600; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .25s; }
.net-pill svg { width: 15px; height: 15px; }
.net-pill[hidden] { display: none; }
