:root {
  /* Estilo "libro de cuentos": papel blanco, bordes gruesos tipo sticker, sin degradados ni sombras difusas.
     El morado es el color de avanzar; el texto normal va en gris para que el color mande. */
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #3c3f58;
  --muted: #626780;
  --line: #e5e6ef;
  --primary: #5b5ff5;
  --primary-dark: #4144c9;
  --primary-soft: #eceeff;
  --ok: #22b566;
  --ok-dark: #178a4c;
  --ok-soft: #e3f8ec;
  --bad: #ef4b5c;
  --bad-dark: #c42f40;
  --bad-soft: #fde8ea;
  --gold: #ffb800;
  --surface: #ffffff;       /* recuadros blancos dentro de otros recuadros */
  --warn-bg: #fff8e1;       /* consejos y avisos (amarillo suave) */
  --warn-line: #ffe7a3;
  --warn-ink: #b07d00;
  --info-bg: #eef6ff;       /* gramática (azul suave) */
  --info-line: #cfe3ff;
  --gold-soft: #fff5d6;
  --topbar: #ffffff;
  --radius: 20px;
  --fs: 17px;
  color-scheme: light;
}

/* Modo oscuro: lo activa app.js con data-theme="dark" (automático según el celular o elegido en Ajustes). */
:root[data-theme="dark"] {
  --bg: #12141f;
  --card: #1c1f2e;
  --ink: #eef0fa;
  --muted: #9aa0bf;
  --line: #2e3248;
  --primary: #767af8;
  --primary-dark: #4a4ed0;
  --primary-soft: #262a4f;
  --ok-soft: #143426;
  --ok-dark: #2fd27a;
  --bad-soft: #3d1a21;
  --bad-dark: #ff7b89;
  --surface: #252939;
  --warn-bg: #2b2513;
  --warn-line: #4f4219;
  --warn-ink: #f2c14e;
  --info-bg: #16233a;
  --info-line: #27406a;
  --gold-soft: #3a3115;
  --topbar: #12141f;
  color-scheme: dark;
}
:root[data-theme="dark"] body.kids { --primary-soft: #3d2b23; }
:root[data-theme="dark"] .btn.ok { box-shadow: 0 4px 0 #178a4c; }
:root[data-theme="dark"] .btn.bad { box-shadow: 0 4px 0 #c42f40; }
:root[data-theme="dark"] .mic.listening { box-shadow: 0 6px 0 #c42f40; }
:root[data-theme="dark"] .hangup { box-shadow: 0 6px 0 #c42f40; }
:root[data-theme="dark"] .avatar { box-shadow: 0 3px 0 rgba(0,0,0,.35); }
:root[data-theme="dark"] .modal { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .today.all-done { border-color: #1f5a3c; box-shadow: 0 4px 0 #1f5a3c; }
:root[data-theme="dark"] .lesson-top .call-btn,
:root[data-theme="dark"] .call-row .mic.listening { box-shadow: 0 6px 0 #178a4c; }
:root[data-theme="dark"] .call-bar { background: #0b0c14; border-color: #0b0c14; }

body.big { --fs: 21px; }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: var(--fs);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--topbar);
  border-bottom: 2px solid var(--line);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0;
  font-size: 1.05em; font-weight: 800;
}
.logo b { color: var(--primary); }
.logo-badge {
  display: block; width: 38px; height: 38px; border-radius: 11px;
  object-fit: cover; box-shadow: 0 3px 0 var(--line);
}
.top-stats { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 2px solid var(--line);
  font-size: .9em; font-weight: 800; white-space: nowrap;
}
.chip-btn { padding: 6px 10px; }

main { max-width: 640px; margin: 0 auto; padding: 20px 16px 140px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 20px;
  border: 0; border-radius: 16px;
  font-weight: 900; font-size: .95em; letter-spacing: .06em; text-transform: uppercase;
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: transform .08s, box-shadow .08s, opacity .2s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--primary); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn.ok { background: var(--ok); box-shadow: 0 4px 0 var(--ok-dark); }
.btn.bad { background: var(--bad); box-shadow: 0 4px 0 var(--bad-dark); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 160px; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary-dark);
  border: 0; font-weight: 700; font-size: .92em;
}

/* ---------- Home ---------- */
/* Portada: color sólido con dos círculos decorativos (como recortes de papel) y Leo asomándose */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 108% -8%, rgba(255,255,255,.16) 0 120px, transparent 121px),
    radial-gradient(circle at -10% 112%, rgba(255,255,255,.09) 0 140px, transparent 141px),
    var(--primary);
  color: #fff; border-radius: 28px; padding: 22px 18px 18px;
  margin-bottom: 28px; box-shadow: 0 6px 0 var(--primary-dark);
}
.hero-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.hero-text { flex: 1; min-width: 0; padding-top: 4px; }
.hero h1 { margin: 0 0 6px; font-size: 1.85em; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.hero p { margin: 0; opacity: .9; line-height: 1.4; font-size: .95em; text-wrap: pretty; }
.hero-mascot { flex: none; margin: -4px -4px 0 0; transform: rotate(6deg); }
.hero-mascot .avatar { box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.hero .btn.secondary { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0;
  background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 10px 12px;
}
.stat .s-ico { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.stat b { font-size: 1.35em; font-weight: 900; line-height: 1.1; }
.stat b i { font-style: normal; font-size: .62em; opacity: .75; }
.stat small { font-size: .74em; font-weight: 700; opacity: .85; line-height: 1.2; }

.section-title { font-weight: 900; font-size: 1.35em; margin: 0 0 12px; color: var(--primary); letter-spacing: -.01em; }
.section-title small { display: block; margin-top: 2px; color: var(--muted); font-size: .58em; font-weight: 700; letter-spacing: 0; }

.path { display: grid; gap: 12px; }
.unit {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 16px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line);
  transition: transform .1s;
}
.unit:disabled { opacity: .5; cursor: not-allowed; }
.unit .u-emoji {
  flex: none; display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--primary-soft); font-size: 30px;
}
.unit.done .u-emoji { background: var(--gold-soft); }
.unit .u-body { flex: 1; min-width: 0; }
.unit .u-title { font-weight: 800; font-size: 1.05em; }
.unit .u-sub { color: var(--muted); font-size: .88em; }
.unit .u-stars { font-size: 1.05em; letter-spacing: 1px; white-space: nowrap; }
.unit .u-num { color: var(--muted); font-size: .75em; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
/* La unidad donde vas: resaltada, y el inicio baja solo hasta ella */
.unit.current { border-color: var(--primary); box-shadow: 0 4px 0 var(--primary); }
.unit.current .u-emoji { background: var(--primary); }
.here-pill {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--primary); color: #fff; letter-spacing: .02em; text-transform: none;
}
.unit.arrive { animation: arrive .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes arrive { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: none; } }

/* ---------- Unit intro ---------- */
.intro-head { text-align: center; margin: 10px 0 20px; }
.intro-head .big-emoji { font-size: 72px; }
.intro-head h2 { margin: 6px 0 4px; font-size: 1.7em; font-weight: 900; color: var(--primary); letter-spacing: -.02em; }
.intro-head p { margin: 0; color: var(--muted); }
.tip {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-bg); border: 2px solid var(--warn-line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px; line-height: 1.45;
}
.tip .tip-icon { font-size: 26px; }
.phrase-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; }
.phrase-list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
}
.phrase-list .p-emoji { font-size: 24px; }
.phrase-list .p-text { flex: 1; }
.phrase-list .p-es { color: var(--muted); font-size: .85em; }
.phrase-list .speak-mini { background: none; border: 0; font-size: 20px; padding: 4px; }

/* ---------- Lesson ---------- */
.lesson-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.close-btn { background: none; border: 0; font-size: 26px; color: var(--muted); padding: 0 4px; line-height: 1; }
.progress { flex: 1; height: 16px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .35s ease; box-shadow: inset 0 4px 0 rgba(255,255,255,.28); }

.prompt { font-weight: 900; font-size: 1.3em; margin: 0 0 18px; }

.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; text-align: center;
}
.card .big-emoji { font-size: 76px; line-height: 1.1; }
.card .en { font-size: 1.7em; font-weight: 900; margin: 12px 0 4px; }
.card .es { color: var(--muted); font-size: 1.05em; }
.card .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

.say-line {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 20px;
}
.say-line .speaker {
  flex: none; width: 54px; height: 54px; border-radius: 16px; border: 0;
  background: var(--primary); color: #fff; font-size: 24px;
  box-shadow: 0 3px 0 var(--primary-dark);
}
.say-line .text { font-size: 1.3em; font-weight: 800; text-align: left; }

.listen-box { display: flex; justify-content: center; gap: 16px; margin: 10px 0 28px; }
.listen-box .speaker-big {
  width: 110px; height: 110px; border-radius: 30px; border: 0;
  background: var(--primary); color: #fff; font-size: 48px;
  box-shadow: 0 6px 0 var(--primary-dark);
}
.listen-box .speaker-slow {
  width: 70px; height: 70px; align-self: flex-end; border-radius: 22px; border: 0;
  background: var(--primary-soft); font-size: 30px;
}

.options { display: grid; gap: 10px; }
.option {
  width: 100%; padding: 16px 18px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 3px 0 var(--line); font-weight: 700;
}
.option.correct { background: var(--ok-soft); border-color: var(--ok); box-shadow: 0 3px 0 var(--ok); }
.option.wrong { background: var(--bad-soft); border-color: var(--bad); box-shadow: 0 3px 0 var(--bad); }
.option:disabled { cursor: default; }

/* Build sentence */
.answer-zone {
  min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  padding: 10px 0; margin-bottom: 18px;
  border-bottom: 2px solid var(--line); border-top: 2px solid var(--line);
}
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 24px; }
.word {
  padding: 10px 14px; border-radius: 12px;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  font-weight: 700;
}
.word.used { visibility: hidden; }

/* Speak */
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 26px 0 10px; }
.mic {
  width: 104px; height: 104px; border-radius: 50%; border: 0;
  background: var(--primary); color: #fff; font-size: 44px;
  box-shadow: 0 6px 0 var(--primary-dark);
}
.mic.listening { background: var(--bad); box-shadow: 0 6px 0 var(--bad-dark); animation: pulse 1.1s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 6px 0 var(--bad-dark), 0 0 0 0 rgba(239,75,92,.45); }
  70% { box-shadow: 0 6px 0 var(--bad-dark), 0 0 0 22px rgba(239,75,92,0); }
  100% { box-shadow: 0 6px 0 var(--bad-dark), 0 0 0 0 rgba(239,75,92,0); }
}
.mic-hint { color: var(--muted); font-size: .9em; text-align: center; }
.heard { margin-top: 10px; text-align: center; line-height: 1.6; }
.heard .w-ok { color: var(--ok-dark); font-weight: 800; }
.heard .w-bad { color: var(--bad); font-weight: 800; text-decoration: underline wavy; }
.heard .you-said { color: var(--muted); font-size: .88em; }
.notice {
  background: var(--warn-bg); border: 2px solid var(--warn-line); border-radius: 16px;
  padding: 14px 16px; line-height: 1.45; margin-top: 16px; text-align: left;
}
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; margin-top: 8px; font-size: .9em; }

/* Dialogue */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.bubble {
  max-width: 85%; padding: 12px 16px; border-radius: 20px; line-height: 1.4;
  animation: pop .25s ease;
}
.bubble .b-es { display: block; font-size: .8em; opacity: .75; margin-top: 4px; }
.bubble.bot { align-self: flex-start; background: var(--card); border: 2px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.you { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot .replay { background: none; border: 0; padding: 0 0 0 6px; font-size: .95em; }
.bot-name { font-weight: 800; font-size: .75em; color: var(--muted); margin-bottom: 2px; }
.your-turn {
  background: var(--primary-soft); border-radius: var(--radius); padding: 16px; text-align: center;
}
.your-turn .label { font-size: .8em; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--primary-dark); }
.your-turn .en { font-size: 1.25em; font-weight: 900; margin: 6px 0 2px; }
.your-turn .es { color: var(--muted); font-size: .9em; }
.your-turn .mic-wrap { margin: 16px 0 4px; }
.your-turn .mic { width: 84px; height: 84px; font-size: 36px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* Footer / feedback */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--bg); border-top: 2px solid var(--line);
  padding: 16px;
}
.footer-inner { max-width: 640px; margin: 0 auto; }
.footer.ok { background: var(--ok-soft); border-color: var(--ok-soft); }
.footer.bad { background: var(--bad-soft); border-color: var(--bad-soft); }
.fb-title { font-weight: 900; font-size: 1.2em; margin-bottom: 4px; }
.footer.ok .fb-title { color: var(--ok-dark); }
.footer.bad .fb-title { color: var(--bad-dark); }
.fb-detail { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-detail .speak-mini { background: none; border: 0; font-size: 20px; padding: 0; }

/* Finish */
.finish { text-align: center; padding-top: 20px; }
.finish .big-emoji { font-size: 90px; animation: pop .5s ease; }
.finish h2 { font-size: 1.9em; font-weight: 900; margin: 10px 0 6px; color: var(--primary); letter-spacing: -.02em; }
.finish .stars { font-size: 44px; letter-spacing: 6px; margin: 14px 0; }
.finish .star-off { filter: grayscale(1); opacity: .3; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 28px; }
.result-box { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 6px; }
.result-box b { display: block; font-size: 1.4em; }
.result-box span { color: var(--muted); font-size: .8em; }
.finish .btn-row { flex-direction: column; }
.finish .btn-row .btn { flex: none; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center; padding: 16px;
  background: rgba(20, 22, 40, .45);
}
.modal.hidden { display: none; }
.modal-card { background: var(--card); border-radius: 24px; padding: 24px; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-card h3 { margin: 0 0 16px; font-size: 1.3em; font-weight: 900; }
.setting { margin-bottom: 18px; }
.setting .s-label { font-weight: 800; margin-bottom: 8px; }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; padding: 10px 6px; border-radius: 12px;
  background: var(--bg); border: 2px solid var(--line); font-weight: 700; font-size: .9em;
}
.seg button.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.danger-text { color: var(--bad); }
.danger-link {background: none; border: 0; color: var(--bad); font-weight: 700; padding: 0; margin: 4px 0 18px; }

.hidden { display: none !important; }
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 30;
  width: calc(100% - 32px); max-width: 480px; padding: 14px 18px; border-radius: 16px;
  background: var(--ink); color: var(--bg); font-weight: 700; line-height: 1.4;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); animation: pop .25s ease; cursor: pointer;
}
.s-note { color: var(--muted); font-size: .88em; line-height: 1.45; margin-bottom: 8px; }
.account-form { display: flex; gap: 8px; margin: 8px 0; }
.account-form input, .composer-row input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--bg); font: inherit; color: inherit;
}
.account-form input:focus, .composer-row input:focus { outline: none; border-color: var(--primary); }

/* ---------- Bienvenida y prueba de nivel ---------- */
.welcome { text-align: center; padding-top: 16px; }
.welcome-emoji { font-size: 72px; }
.welcome h1 { font-size: 1.7em; font-weight: 900; margin: 8px 0; color: var(--primary); letter-spacing: -.02em; }
.welcome > p { color: var(--muted); line-height: 1.5; margin: 0 0 26px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.choice-grid.one-col { grid-template-columns: 1fr; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 12px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line);
}
.choice > span:first-child { font-size: 48px; }
.choice small { color: var(--muted); font-size: .82em; }
.choice.row { flex-direction: row; text-align: left; gap: 16px; padding: 18px; }
.choice.row > span:first-child { font-size: 36px; }
.choice.row b, .choice.row small { display: block; }
.test-badge {
  display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: .78em; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.gap { color: var(--primary); }

/* ---------- Tutor ---------- */
.tutor-card {
  display: flex; align-items: center; gap: 16px; width: 100%; margin-bottom: 26px;
  padding: 16px; text-align: left; border-radius: var(--radius);
  background: var(--warn-bg); border: 2px solid var(--warn-line); box-shadow: 0 4px 0 var(--warn-line);
}
.tutor-avatar {
  flex: none; display: grid; place-items: center; width: 58px; height: 58px;
  border-radius: 50%; background: var(--surface); font-size: 32px;
}
.tutor-card .u-num { color: var(--warn-ink); font-size: .75em; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.tutor-card .u-title { font-weight: 800; font-size: 1.05em; }
.tutor-card .u-sub { color: var(--muted); font-size: .88em; }
.tutor-go { font-size: 32px; color: var(--warn-ink); }

.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.topic {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px; text-align: left; border-radius: 16px;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
}
.topic-emoji { font-size: 28px; margin-bottom: 4px; }
.topic small { color: var(--muted); font-size: .8em; }

.chat-title { font-weight: 900; }
.chat-title small { color: var(--muted); font-weight: 600; }
.tutor-chat .bubble.bot { max-width: 88%; }
.bubble-tools { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.bubble .replay { background: none; border: 0; padding: 2px 4px; font-size: 1em; }
.bubble .translate {
  background: var(--primary-soft); color: var(--primary-dark); border: 0;
  border-radius: 999px; padding: 3px 10px; font-size: .78em; font-weight: 700;
}
.bubble.fix {
  align-self: flex-end; max-width: 85%; margin-top: -4px;
  background: var(--warn-bg); border: 2px solid var(--warn-line); border-bottom-right-radius: 6px; font-size: .92em;
}
.fix-label { font-weight: 800; font-size: .8em; color: var(--warn-ink); }
.fix-text { font-weight: 800; }
.fix-tip { color: var(--muted); font-size: .88em; margin-top: 4px; }
.bubble.system { align-self: stretch; max-width: 100%; padding: 0; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-spacer { height: 60px; }

.composer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.composer-hint { color: var(--muted); font-size: .85em; text-align: center; margin-bottom: 8px; }
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer .send {
  flex: none; width: 48px; height: 48px; border-radius: 14px; border: 0;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 20px;
}
.mic.small { flex: none; width: 64px; height: 64px; font-size: 28px; }

/* ---------- Niños ---------- */
.picture-box { font-size: 120px; text-align: center; margin: 0 0 20px; animation: pop .35s ease; }
.picture-options .option { text-align: center; font-size: 1.2em; }
body.kids { --primary: #ff7a45; --primary-dark: #e0551c; --primary-soft: #ffeee6; --radius: 26px; }
body.kids .hero { background: var(--primary); }
body.kids .unit .u-emoji { width: 66px; height: 66px; font-size: 36px; border-radius: 22px; }
body.kids .card .big-emoji { font-size: 96px; }
body.kids .card .en { font-size: 2em; }

/* ---------- Acceso (crear cuenta / iniciar sesión) ---------- */
body.auth-mode .top-stats { visibility: hidden; }
.auth { max-width: 440px; margin: 0 auto; padding-top: 8px; }
.auth-hero { text-align: center; margin-bottom: 18px; }
.auth-cast { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin-bottom: 10px; }
.auth-hero h1 { margin: 0 0 6px; font-size: 1.7em; font-weight: 900; }
.auth-hero h1 span { color: var(--primary); }
.auth-hero p { margin: 0; color: var(--muted); line-height: 1.45; }
.auth-card {
  background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 20px;
  box-shadow: 0 4px 0 var(--line); text-align: center;
}
.auth-tabs { display: flex; gap: 6px; background: var(--bg); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button {
  flex: 1; padding: 10px; border: 0; border-radius: 11px; background: none;
  font-weight: 800; color: var(--muted);
}
.auth-tabs button.active { background: var(--card); color: var(--primary-dark); box-shadow: 0 2px 0 var(--line); }
.auth form { display: grid; gap: 12px; text-align: left; }
.auth label { display: grid; gap: 6px; font-weight: 800; font-size: .9em; }
.auth input {
  width: 100%; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--bg); font: inherit; color: inherit;
}
.auth input:focus { outline: none; border-color: var(--primary); }
.pass-row { position: relative; display: block; }
.pass-row input { padding-right: 48px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 18px; padding: 6px; }
.code-input { text-align: center; font-size: 1.5em !important; letter-spacing: 6px; font-weight: 800; }
.auth-msg { min-height: 1.2em; color: var(--bad-dark); font-weight: 700; font-size: .9em; }
.auth-title { margin: 0 0 6px; font-weight: 900; font-size: 1.3em; }
.auth-sub { margin: 0 0 16px; color: var(--muted); line-height: 1.45; font-size: .92em; }
.auth-legal { color: var(--muted); font-size: .8em; line-height: 1.45; margin: 14px 0 0; }
.auth-legal a, #auth-form label a { color: var(--primary); }
.auth .link-btn { display: block; margin: 12px auto 0; }
.account-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Permiso antes de conversar con la IA */
.consent { text-align: center; }
.consent h2 { font-weight: 900; font-size: 1.4em; margin: 10px 0 8px; }
.consent p { line-height: 1.5; margin: 0 0 12px; }
.consent ul {
  list-style: none; padding: 14px 16px; margin: 0 0 12px; text-align: left; line-height: 1.5;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px;
}
.consent li + li { margin-top: 6px; }
.consent .btn-row .btn { flex: none; }

/* Pantalla de carga */
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-weight: 700; }

/* Continuar donde quedaste */
.continue {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 14px;
  background: var(--surface); color: var(--ink); border: 0; border-radius: 16px; text-align: left;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: transform .08s, box-shadow .08s;
}
.continue:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-dark); }
.continue small { display: block; color: var(--muted); font-weight: 700; font-size: .78em; text-transform: uppercase; letter-spacing: .05em; }
.continue b { font-size: 1.02em; }
.continue .c-play {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 16px;
}
.all-done { margin: 14px 0 0; font-weight: 700; }

/* ---------- Meta diaria ---------- */
.daily-goal { margin-top: 16px; background: rgba(255,255,255,.16); border-radius: 16px; padding: 12px 14px; }
.dg-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .92em; }
.dg-bar { height: 12px; background: rgba(255,255,255,.28); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.dg-bar > div { height: 100%; background: #ffd24d; border-radius: 999px; transition: width .5s ease; }
.daily-goal.met .dg-bar > div { background: #5fe39a; }
.dg-note { font-size: .8em; opacity: .92; }

/* ---------- Tarjetas pequeñas (logros y juego) ---------- */
.mini-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 32px; }
.mini-card {
  --tint: var(--primary); --tint-soft: var(--primary-soft);
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line); text-align: left;
}
.mini-card b { font-size: .98em; line-height: 1.2; text-wrap: balance; }
.mini-card .mc-icon {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 10px;
  border-radius: 14px; background: var(--tint-soft); font-size: 26px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.06);
}
.mini-card small { color: var(--muted); font-size: .8em; line-height: 1.3; margin-top: 2px; }
.mini-card.tint-gold { --tint-soft: #fff1c7; }
.mini-card.tint-green { --tint-soft: #dcf7e6; }
.mini-card.tint-pink { --tint-soft: #ffe1ef; }
.mini-card.tint-blue { --tint-soft: #dcf1ff; }
.mini-card.tint-red { --tint-soft: #ffe2e2; }
.mini-card.tint-purple { --tint-soft: #ebe6ff; }
:root[data-theme="dark"] .mini-card { --tint-soft: #262a4f; }

/* ---------- Mis logros ---------- */
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.medal-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px;
  padding: 14px 8px; border-radius: 18px; background: var(--card); border: 2px solid var(--line);
}
.medal-card .m-icon { font-size: 38px; line-height: 1.1; }
.medal-card b { font-size: .85em; line-height: 1.2; }
.medal-card small { color: var(--muted); font-size: .7em; line-height: 1.3; }
.medal-card.won { border-color: #ffd24d; background: var(--gold-soft); box-shadow: 0 3px 0 var(--warn-line); }
.medal-card.locked { opacity: .55; }
.medal-card .m-date { color: var(--warn-ink); font-weight: 800; }

/* ---------- Celebración ---------- */
.modal-card.celebrate { text-align: center; position: relative; overflow: hidden; }
.celebrate .confetti { font-size: 22px; letter-spacing: 6px; animation: pop .5s ease; }
.celebrate .medal {
  width: 110px; height: 110px; margin: 8px auto 6px; border-radius: 50%; display: grid; place-items: center;
  font-size: 58px; background: radial-gradient(circle at 35% 30%, #fff6c9, #ffd24d); box-shadow: 0 6px 0 #e6b100;
  animation: medal .7s cubic-bezier(.3,1.6,.5,1);
}
@keyframes medal { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate .c-kicker { margin: 8px 0 0; color: var(--primary); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: .82em; }
.celebrate h3 { margin: 4px 0; }
.celebrate .c-desc { color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.celebrate .c-host { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; font-weight: 800; }

/* ---------- Juego de parejas ---------- */
.memory-stats { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.memory-stats b { color: var(--ink); }
.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-card { aspect-ratio: 3 / 3.4; padding: 0; border: 0; background: none; perspective: 700px; }
.m-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.m-card.flipped .m-inner, .m-card.matched .m-inner { transform: rotateY(180deg); }
.m-back, .m-front {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 6px; box-sizing: border-box;
}
.m-back { background: var(--primary); color: #fff; font-size: 34px; font-weight: 900; box-shadow: 0 4px 0 var(--primary-dark); }
.m-front { transform: rotateY(180deg); background: var(--card); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.m-front.en { background: var(--primary-soft); border-color: var(--primary); }
.m-card.matched .m-front { background: var(--ok-soft); border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); }
.mc-en { font-weight: 900; font-size: .9em; line-height: 1.2; color: var(--primary-dark); }
.mc-es { font-weight: 700; font-size: .8em; line-height: 1.2; }
.mc-emoji { font-size: 44px; line-height: 1; }
.mc-emoji.small { font-size: 26px; }

/* ---------- Invitación a elegir la hora del recordatorio ---------- */
.ask-reminder { text-align: center; padding-top: 12px; }
.ask-reminder h2 { font-weight: 900; font-size: 1.45em; margin: 12px 0 6px; }
.ask-reminder > p { color: var(--muted); line-height: 1.5; margin: 0 0 18px; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.time-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 3px 0 var(--line);
}
.time-opt span { font-size: 28px; }
.time-opt small { color: var(--muted); font-weight: 700; }
.time-opt.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); }
.time-opt.active small { color: var(--primary-dark); }
.time-custom { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.time-custom input { padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); font: inherit; color: inherit; }
.ask-reminder .btn { margin-top: 4px; }
.ask-reminder .link-btn { display: block; margin: 12px auto 4px; }

/* Leo cuando llegas tarde a tu hora de práctica */
.late-greeting .late-leo { margin: 6px auto 4px; display: block; }
.late-greeting h3 { margin: 10px 0 6px; font-size: 1.35em; font-weight: 900; }
.late-greeting .btn-row .btn { flex: none; }
.late-greeting .link-btn { margin: 10px auto 0; }

/* ---------- Ajustes: meta y recordatorio ---------- */
.seg-sub { display: block; font-size: .72em; color: var(--muted); font-weight: 600; margin-top: 2px; }
.reminder-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reminder-row input[type="time"] {
  padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); font: inherit; color: inherit;
}
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch span::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ---------- Personajes ---------- */
.avatar {
  display: inline-block; flex: none; width: var(--size, 64px); height: var(--size, 64px);
  border-radius: 50%; overflow: hidden; vertical-align: middle;
  box-shadow: 0 3px 0 rgba(0,0,0,.08);
  transition: transform .2s;
}
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar .c-eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
.avatar[data-char="tom"] .c-eyes { animation-delay: 1.3s; }
.avatar[data-char="mia"] .c-eyes { animation-delay: 2.1s; }
.avatar[data-char="lee"] .c-eyes { animation-delay: .7s; }
.avatar[data-char="sara"] .c-eyes { animation-delay: 1.8s; }
.avatar[data-char="max"] .c-eyes { animation-delay: 2.6s; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.avatar .c-mouth > * { display: none; }
.avatar[data-mood="idle"] .m-smile,
.avatar[data-mood="talk"] .m-talk,
.avatar[data-mood="happy"] .m-happy,
.avatar[data-mood="sad"] .m-sad,
.avatar[data-mood="think"] .m-think { display: inline; }
.avatar .m-talk { transform-box: fill-box; transform-origin: center; animation: talk .22s infinite alternate; }
@keyframes talk { from { transform: scaleY(.25); } to { transform: scaleY(1.1); } }
.avatar[data-mood="happy"] { animation: jump .5s ease 2; }
@keyframes jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px) rotate(-4deg); } }
.avatar[data-mood="sad"] .c-head { transform-box: fill-box; transform-origin: center bottom; animation: tilt 1.2s ease; }
@keyframes tilt { 50% { transform: rotate(-6deg); } }
/* Ojos grandes: las pupilas miran alrededor de vez en cuando */
.avatar .c-pupil { animation: look 7s ease-in-out infinite; }
.avatar[data-char="tom"] .c-pupil { animation-delay: -2s; }
.avatar[data-char="mia"] .c-pupil { animation-delay: -4.5s; }
.avatar[data-char="lee"] .c-pupil { animation-delay: -1s; }
.avatar[data-char="sara"] .c-pupil { animation-delay: -3.3s; }
.avatar[data-char="max"] .c-pupil { animation-delay: -5.6s; }
.avatar[data-char="rose"] .c-pupil { animation-delay: -6.2s; }
.avatar[data-char="leo"] .c-pupil { animation-delay: -2.7s; }
@keyframes look {
  0%, 38%, 100% { transform: translate(0, 0); }
  44%, 56% { transform: translate(1.8px, -.3px); }
  62%, 74% { transform: translate(-1.8px, .3px); }
  80% { transform: translate(0, 0); }
}
/* Felices: ojos en arco (^^) */
.avatar .c-eyes-happy { display: none; }
.avatar[data-mood="happy"] .c-eyes { display: none; }
.avatar[data-mood="happy"] .c-eyes-happy { display: inline; }
/* Pensando: miran hacia arriba */
.avatar[data-mood="think"] .c-pupil { transform: translate(2.2px, -2.6px); animation: none; }
.avatar[data-mood="think"] .c-eyes { animation: none; }
/* Tristes o animando: miran un poco hacia abajo */
.avatar[data-mood="sad"] .c-pupil { transform: translate(0, 1.6px); animation: none; }
.avatar[data-mood="talk"] .c-head { transform-box: fill-box; transform-origin: center bottom; animation: nod 1.4s ease-in-out infinite; }
@keyframes nod { 50% { transform: rotate(2deg); } }

/* Personaje con globo de diálogo */
.char-line { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.char-line .speech {
  position: relative; flex: 1; background: var(--card); border: 2px solid var(--line);
  border-radius: 18px 18px 18px 6px; padding: 10px 14px; line-height: 1.35;
}
.char-line .speech b { display: block; font-size: .78em; color: var(--muted); }
.char-line .speech small { display: block; color: var(--muted); font-size: .82em; margin-top: 2px; }

/* Guía en el inicio */
.guide {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 18px; padding: 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  text-align: left; box-shadow: 0 4px 0 var(--line);
}
.guide .speech { flex: 1; }
.guide .g-name { font-size: .78em; font-weight: 800; color: var(--muted); }
.guide .g-en { font-weight: 800; font-size: 1.05em; }
.guide .g-es { color: var(--muted); font-size: .88em; }
.guide .g-hint { color: var(--primary); font-size: .78em; font-weight: 700; margin-top: 4px; }

/* Reacción en el pie de retroalimentación */
.fb-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.fb-row .fb-text { flex: 1; }
.fb-row .fb-detail { margin-bottom: 0; }

/* Conversaciones con cara */
.bubble-row { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 92%; }
.bubble-row .bubble.bot { max-width: none; }

/* Emma en el tutor */
.tutor-head { display: flex; align-items: center; gap: 12px; margin: -6px 0 16px; }
.tutor-head .t-status { color: var(--muted); font-size: .88em; }

@media (max-width: 420px) {
  .topic-grid { grid-template-columns: 1fr; }
  .logo span:last-child { display: none; }
  .card .en { font-size: 1.45em; }
}

/* ---------- Tu sesión de hoy ---------- */
.today {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line); padding: 14px; margin-bottom: 18px;
}
.today.all-done { background: var(--ok-soft); border-color: #bfeccf; box-shadow: 0 4px 0 #bfeccf; }
.today-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.today-head b { display: block; font-size: 1.08em; font-weight: 900; }
.today-head small { color: var(--muted); font-size: .85em; }
.today-steps { display: grid; gap: 8px; margin-bottom: 12px; }
.today.all-done .today-steps { margin-bottom: 0; }
.today-step {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left;
  background: var(--bg); border: 2px solid var(--line); border-radius: 14px;
}
.today-step .ts-check {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary-soft); font-size: 20px;
}
.today-step.done .ts-check { background: var(--ok); color: #fff; font-weight: 900; }
.today-step.done b { text-decoration: line-through; color: var(--muted); }
.today-step .ts-text { flex: 1; min-width: 0; }
.today-step .ts-text b { display: block; font-size: .95em; }
.today-step .ts-text small { color: var(--muted); font-size: .8em; }
.today-step .ts-go { color: var(--primary); font-size: 24px; font-weight: 900; }

/* Tarjeta con contador (repaso pendiente) */
.mini-card { position: relative; }
.mini-card:disabled { opacity: .6; transform: none; }
.mc-badge {
  position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 999px; background: var(--bad); color: #fff;
  font-weight: 900; font-size: .8em;
}

/* ---------- Niveles, gramática e historias ---------- */
.level-header { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; color: var(--muted); font-weight: 900; font-size: .9em; }
.level-header::before, .level-header::after { content: ''; flex: 1; height: 2px; background: var(--line); }
/* En el camino del inicio, cada nivel es una franja de color, como el capítulo de un libro */
.trail .level-header {
  display: block; margin: 18px 0 8px; padding: 14px 18px; border-radius: 18px;
  background: var(--primary); color: #fff; font-size: 1em; box-shadow: 0 4px 0 var(--primary-dark);
}
.trail .level-header::before, .trail .level-header::after { display: none; }
.trail .level-header small { display: block; opacity: .85; font-size: .75em; letter-spacing: .08em; text-transform: uppercase; }
.trail .level-header.lv-B1 { background: #1cb0f6; box-shadow: 0 4px 0 #1290cc; }
.trail .level-header.lv-B2 { background: #ff7a45; box-shadow: 0 4px 0 #e0551c; }
.trail .level-header.lv-C1 { background: #9b5de5; box-shadow: 0 4px 0 #7a3fc4; }
.trail .level-header.lv-C2 { background: #2d3047; box-shadow: 0 4px 0 #14152a; }

/* Oído primero (C1–C2): el texto se ve borroso hasta escuchar la frase. */
.ear-hidden { filter: blur(9px); opacity: .5; user-select: none; pointer-events: none; transition: filter .35s, opacity .35s; }
.ear-text, .shadow-answer { transition: filter .35s, opacity .35s; }
.native-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--line); font-size: .9em; line-height: 1.45; text-align: left; }
.shadow-tip { text-align: center; color: var(--muted); font-size: .92em; margin: 8px 0 0; }
.shadow-answer { margin-top: 14px; }
.level-header:first-child { margin-top: 0; }
.grammar {
  background: var(--info-bg); border: 2px solid var(--info-line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px; line-height: 1.5;
}
.grammar .gr-title { font-weight: 900; margin-bottom: 4px; }
.grammar p { margin: 0 0 10px; }
.gr-ex { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 8px 10px; margin-top: 6px; }
.gr-ex span { display: flex; flex-direction: column; }
.gr-ex small { color: var(--muted); }
.gr-ex .speak-mini { background: none; border: 0; font-size: 20px; padding: 0; }
.story {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 20px;
}
.story .row { display: flex; flex-wrap: wrap; gap: 8px; }
.story-en { font-size: 1.08em; line-height: 1.6; margin: 12px 0 0; font-weight: 600; }
.story-es { color: var(--muted); line-height: 1.5; margin: 10px 0 0; font-size: .92em; }
.hidden { display: none !important; }

/* ---------- Liga semanal ---------- */
.league-join { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; }
.league-join ul { padding-left: 4px; list-style: none; margin: 0 0 14px; line-height: 1.8; }
.league-join label { display: block; font-weight: 800; margin-bottom: 12px; }
.league-join input {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit;
  border: 2px solid var(--line); border-radius: 14px; background: var(--bg);
}
.league-join .btn { width: 100%; }
.league-me { text-align: center; background: var(--primary-soft); color: var(--primary-dark); border-radius: 14px; padding: 10px; margin-bottom: 12px; }
.league-list { display: grid; gap: 6px; margin-bottom: 12px; }
.league-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px;
}
.league-row.me { border-color: var(--primary); background: var(--primary-soft); }
.lr-pos { flex: none; width: 30px; text-align: center; font-weight: 900; font-size: 1.1em; }
.lr-name { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-name small { color: var(--muted); font-weight: 600; }
.lr-xp { font-weight: 900; color: var(--primary-dark); }
.loading-row { text-align: center; color: var(--muted); padding: 20px; }

/* ---------- Modo llamada con Emma ---------- */
.lesson-top .call-btn {
  margin-left: auto; flex: none; border: 0; border-radius: 999px; padding: 8px 14px;
  background: var(--ok); color: #fff; font-weight: 800; font-size: .88em; box-shadow: 0 3px 0 var(--ok-dark);
}
body.call-mode .call-btn { display: none; }
body.call-mode .tutor-head { flex-direction: column; text-align: center; margin: 0 0 18px; }
body.call-mode .tutor-head .avatar { --size: 150px !important; }
body.call-mode .tutor-chat { font-size: .9em; opacity: .9; }
body.call-mode .chat-spacer { height: 170px; }
.call-bar { background: #1f2440; border-color: #1f2440; color: #fff; }
.call-status { text-align: center; font-weight: 800; margin-bottom: 12px; min-height: 1.4em; }
.call-row { display: flex; justify-content: center; align-items: center; gap: 36px; }
.call-row .mic { width: 84px; height: 84px; font-size: 36px; }
.call-row .mic.listening { background: var(--ok); box-shadow: 0 6px 0 var(--ok-dark); animation: pulse-ok 1.1s infinite; }
@keyframes pulse-ok {
  0% { box-shadow: 0 6px 0 var(--ok-dark), 0 0 0 0 rgba(34,181,102,.5); }
  70% { box-shadow: 0 6px 0 var(--ok-dark), 0 0 0 22px rgba(34,181,102,0); }
  100% { box-shadow: 0 6px 0 var(--ok-dark), 0 0 0 0 rgba(34,181,102,0); }
}
.hangup {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 84px; height: 84px; border-radius: 50%; border: 0;
  background: var(--bad); color: #fff; font-size: 30px; box-shadow: 0 6px 0 var(--bad-dark);
}
.hangup small { font-size: 11px; font-weight: 800; }
.lr-more { flex: none; background: none; border: 0; color: var(--muted); font-size: 20px; font-weight: 900; padding: 0 2px 0 6px; line-height: 1; }

/* ---------- Sonidos difíciles ---------- */
.sound-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sound-head > span {
  flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: var(--primary-soft); font-size: 34px;
}
.sound-head b { display: block; font-size: 1.35em; font-weight: 900; }
.sound-head small { color: var(--muted); font-weight: 700; }
.pair-list { display: grid; gap: 10px; }
.pair-row { display: flex; align-items: center; gap: 8px; }
.pair-word {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px;
  background: var(--card); border: 2px solid var(--primary); border-radius: 16px; box-shadow: 0 3px 0 var(--primary);
}
.pair-word.other { border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.pair-word b { font-size: 1.15em; }
.pair-word small, .pair-options small { color: var(--muted); font-size: .8em; font-weight: 600; }
.pair-vs { color: var(--muted); font-weight: 900; font-size: .85em; }
.pair-options { grid-template-columns: 1fr 1fr; }
.pair-options .option { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 1.15em; padding: 20px 10px; }
.speak-note { margin-top: 10px; color: var(--warn-ink); font-size: .9em; font-weight: 700; }

/* ---------- Dictado ---------- */
.dictation { display: grid; gap: 10px; }
.dictation input {
  width: 100%; padding: 16px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: 1.15em; font-weight: 700;
}
.dictation input:focus { outline: none; border-color: var(--primary); }
.dictation input.ok { border-color: var(--ok); background: var(--ok-soft); }
.dictation input.bad { border-color: var(--bad); background: var(--bad-soft); }
.dictation .link-btn { justify-self: center; }
.dict-hint { text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- Compartir progreso ---------- */
.share-card { text-align: center; }
.share-preview { margin-bottom: 12px; }
.share-preview img { width: 100%; max-width: 300px; border-radius: 18px; border: 2px solid var(--line); }
.share-card .btn-row .btn { flex: 1 1 120px; }
.share-card .link-btn { display: block; margin: 12px auto 0; }

/* ---------- ¿Cómo se dice? (fotos) ---------- */
.mini-card.mc-photo { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 16px;
  background: radial-gradient(circle at 100% 0%, rgba(255,255,255,.16) 0 70px, transparent 71px), var(--primary); border-color: transparent; box-shadow: 0 4px 0 var(--primary-dark); color: #fff; }
.mini-card.mc-photo small { color: rgba(255,255,255,.85); }
.photo-actions { display: grid; gap: 10px; margin-bottom: 18px; }
.photo-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 22px; display: grid; gap: 12px;
}
.photo-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; }
.photo-word { text-align: center; }
.photo-word .pw-emoji { font-size: 48px; line-height: 1.1; }
.photo-word .en { font-size: 1.7em; font-weight: 900; margin: 4px 0 2px; }
.photo-word .es { color: var(--muted); }
.photo-word .pw-sounds { margin-top: 8px; color: var(--warn-ink); font-weight: 700; font-size: .92em; }
.photo-word .row { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.pw-example { margin-top: 0; background: var(--bg); }
.photo-card .mic-wrap { margin: 6px 0 0; }
.photo-words { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  background: var(--card); border: 2px solid var(--line); font-size: .9em;
}
.photo-chip small { color: var(--muted); }
.consent .big-emoji { font-size: 72px; line-height: 1.1; }

/* ---------- Camino del inicio (paradas redondas que serpentean) ---------- */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); }
.trail { display: block; padding: 6px 0 10px; }
.trail-row {
  position: relative; display: flex; justify-content: center; margin: 0 0 10px;
  transform: translateX(var(--x, 0));
  animation: trail-in .4s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 10) * 40ms);
}
@keyframes trail-in { from { opacity: 0; transform: translateX(var(--x, 0)) translateY(10px); } }
.trail .unit {
  position: relative; flex-direction: column; gap: 6px; width: auto; max-width: 150px;
  padding: 0; background: none; border: 0; box-shadow: none; text-align: center;
}
.trail .unit:hover:not(:disabled) { transform: none; }
.trail .unit:disabled { opacity: 1; }
.trail .u-node {
  display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  background: var(--primary); font-size: 34px; line-height: 1;
  box-shadow: 0 7px 0 var(--primary-dark);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.trail .unit:active:not(:disabled) .u-node { transform: translateY(5px); box-shadow: 0 2px 0 var(--primary-dark); }
.trail .unit.done .u-node { background: var(--gold); box-shadow: 0 7px 0 #d99a00; }
.trail .unit.done:active .u-node { box-shadow: 0 2px 0 #d99a00; }
.trail .unit.locked .u-node { background: var(--line); box-shadow: 0 7px 0 #cfd1de; font-size: 26px; filter: grayscale(1); }
/* La parada donde vas: un anillo alrededor y un globo que dice "Estás aquí" */
.trail .unit.current .u-node { outline: 6px solid var(--primary-soft); outline-offset: 4px; }
.trail .unit.current { padding-top: 40px; }
.trail .here-pill {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap;
  padding: 6px 12px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); color: var(--primary); font-weight: 900; font-size: .8em;
  letter-spacing: .06em; text-transform: uppercase;
  animation: bob 1.6s ease-in-out infinite;
}
.trail .here-pill::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; margin-left: -6px;
  background: var(--card); border: 2px solid var(--line); border-top: 0; border-left: 0; transform: rotate(45deg);
}
@keyframes bob { 50% { transform: translateX(-50%) translateY(-4px); } }
.trail .u-label b { display: block; font-size: .92em; font-weight: 900; line-height: 1.2; text-wrap: balance; }
.trail .u-label small { display: block; color: var(--muted); font-size: .75em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.trail .unit.locked .u-label { opacity: .55; }
.trail .unit.arrive { animation: none; }
.trail .unit.arrive .u-node { animation: arrive .7s cubic-bezier(.3,1.6,.5,1); }
.trail-buddy { position: absolute; top: 6px; pointer-events: none; }
.trail-buddy.on-left { left: calc(50% - var(--x) - 150px); }
.trail-buddy.on-right { right: calc(50% + var(--x) - 150px); }
body.kids .trail .u-node { width: 84px; height: 84px; font-size: 40px; }
:root[data-theme="dark"] .trail .unit.locked .u-node { box-shadow: 0 7px 0 #1f2233; }

/* ---------- Detalles generales ---------- */
.hero h1, .intro-head h2, .finish h2, .welcome h1, .section-title { text-wrap: balance; }
.stat b, .chip, .result-box b, .lr-xp, .dg-top b { font-variant-numeric: tabular-nums; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.option, .choice, .mini-card, .topic, .word, .time-opt, .tutor-card, .guide, .today-step {
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), border-color .15s;
}
.option:active:not(:disabled), .choice:active, .mini-card:active:not(:disabled), .topic:active, .word:active, .time-opt:active {
  transform: translateY(3px); box-shadow: 0 0 0 var(--line);
}
.mic, .speaker, .speaker-big, .speaker-slow { transition: transform .12s var(--ease-out); }
.mic:active, .speaker:active, .speaker-big:active, .speaker-slow:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  .trail-row { animation: none; }
  .trail .here-pill { animation: none; }
  .trail .unit.arrive .u-node { animation: none; }
}

.mini-card.mc-photo .mc-icon { margin: 0; width: 56px; height: 56px; font-size: 30px; background: rgba(255,255,255,.2); box-shadow: none; flex: none; }
.mini-card.mc-photo .mc-text { flex: 1; min-width: 0; }
.mini-card.mc-photo b { display: block; font-size: 1.1em; }
.mini-card.mc-photo .mc-go { font-size: 30px; font-weight: 900; opacity: .9; }

/* Camino: línea punteada entre paradas y brillo en cada botón redondo */
.trail { position: relative; }
.trail-line { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.trail-line path { fill: none; stroke: var(--line); stroke-width: 7; stroke-linecap: round; stroke-dasharray: .1 15; }
.trail-line path.walked { stroke: var(--gold); }
.trail-row, .trail .level-header { position: relative; z-index: 1; }
.trail .u-node { position: relative; }
.trail .u-node::after {
  content: ''; position: absolute; top: 7px; left: 13px; width: 15px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.35); transform: rotate(-28deg);
}
.trail .unit.locked .u-node::after { opacity: .5; }
.trail .u-label { padding: 2px 8px; border-radius: 10px; background: var(--bg); }
.trail-row { margin-bottom: 18px; }

/* ---------- Modo relajado ---------- */
.mini-card.tint-night { --tint-soft: #e6e8ff; }
.relax-setup { display: grid; gap: 14px; }
.relax-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; font-weight: 800;
}
body.relax-mode .topbar { display: none; }
body.relax-mode main { padding-top: 0; }
.relax-player {
  position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 25%, #2d2f63 0, #15162e 55%, #0b0c18 100%); color: #eef0ff; text-align: center;
}
.rp-moon { font-size: 54px; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .8; } }
.rp-card { min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 10px; max-width: 520px; }
.rp-card.in { animation: rp-in .9s var(--ease-out, ease-out); }
@keyframes rp-in { from { opacity: 0; transform: translateY(8px); } }
.rp-emoji { font-size: 64px; line-height: 1.1; }
.rp-en { font-size: 1.9em; font-weight: 900; line-height: 1.2; text-wrap: balance; }
.rp-es { font-size: 1.1em; color: #b9bce6; font-weight: 700; }
.rp-bar { width: min(100%, 360px); height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.rp-bar > div { height: 100%; width: 0; background: #9aa0ff; border-radius: 999px; transition: width .5s linear; }
.rp-time { color: #b9bce6; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp-controls { display: flex; gap: 18px; }
.rp-btn {
  width: 68px; height: 68px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font-size: 26px;
}
.rp-btn:active { transform: scale(.95); }
@media (prefers-reduced-motion: reduce) { .rp-moon, .rp-card.in { animation: none; } }

/* ---------- Emma: correcciones al final ---------- */
.fix-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px; }
.fix-mode, .fix-see {
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .82em;
}
.fix-see { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.fix-list { display: grid; gap: 10px; }
.fix-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line); padding: 14px 16px; line-height: 1.4;
}
.fc-said { color: var(--muted); font-size: .9em; }
.fc-said s { color: var(--bad); text-decoration-thickness: 2px; }
.fc-good { margin-top: 6px; color: var(--ok-dark); font-size: 1.1em; }
.fc-good .replay { background: none; border: 0; padding: 0 2px; font-size: 1em; }
.fc-es { color: var(--muted); font-size: .88em; }
.fc-tip { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); font-size: .9em; }

/* Efectos al pasar el mouse solo en computador: en el celular el último toque dejaba
   "marcada" la opción que queda en el mismo lugar del siguiente ejercicio. */
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { filter: brightness(.97); }
  .unit:hover:not(:disabled) { transform: translateY(-2px); }
  .option:hover:not(:disabled) { border-color: var(--primary); }
  .choice:hover { border-color: var(--primary); }
  .tutor-card:hover { transform: translateY(-2px); }
  .topic:hover { border-color: var(--primary); }
}

/* ===== Modo niños sin lectura ===== */
/* Escucha y toca el dibujo */
.emoji-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.option.emoji-option { font-size: 56px; line-height: 1; padding: 18px 0; text-align: center; }
/* ¿Qué es esto?: bocinas de colores en vez de palabras escritas */
.kid-speakers { display: flex; justify-content: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.kid-speaker {
  width: 92px; min-height: 92px; border-radius: 24px; border: 4px solid var(--c); background: var(--card, #fff);
  box-shadow: 0 5px 0 var(--c); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font: inherit; color: inherit; transition: transform .12s;
}
.kid-speaker .ks-ico { font-size: 38px; }
.kid-speaker .ks-word { display: none; font-weight: 900; font-size: .95em; }
.kid-speaker.revealed .ks-word { display: block; }
.kid-speaker.picked { transform: translateY(-4px) scale(1.06); background: color-mix(in srgb, var(--c) 22%, transparent); }
.kid-speaker.correct { border-color: var(--ok); box-shadow: 0 5px 0 var(--ok); background: var(--ok-soft); }
.kid-speaker.wrong { border-color: var(--bad); box-shadow: 0 5px 0 var(--bad); background: var(--bad-soft); }
.kid-speaker:disabled { cursor: default; }
.kid-hint { text-align: center; color: var(--muted); font-size: .9em; margin-top: 14px; }
/* Conversación: el dibujo de lo que hay que decir */
.your-turn .turn-pic { font-size: 64px; line-height: 1.1; margin: 6px 0 0; }
.kids-turn .en { font-size: 1em; color: var(--muted); }

/* Velocidad de la voz en cada lección */
.speed-chip {
  flex: none; border: 2px solid var(--line); background: var(--card); color: var(--text, inherit); border-radius: 999px;
  padding: 5px 10px; font: inherit; font-weight: 800; font-size: .8em; cursor: pointer; white-space: nowrap;
}

/* ===== Modo niños sin cuenta y control parental ===== */
.kid-guest {
  display: block; width: 100%; margin-top: 16px; padding: 14px 16px; border-radius: 18px; text-align: left;
  border: 2px dashed var(--line); background: var(--card); color: inherit; font: inherit; cursor: pointer; line-height: 1.35;
}
.kid-guest b { color: var(--primary); }
.kid-guest small { display: block; color: var(--muted); font-size: .85em; margin-top: 4px; }
.parent-gate { z-index: 60; }
.pg-question { font-size: 1.15em; text-align: center; margin: 14px 0 10px; }
.parent-gate input {
  width: 100%; font: inherit; font-size: 1.4em; text-align: center; padding: 10px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--bg, var(--card)); color: inherit; margin-bottom: 6px;
}

/* Minutos de escucha en la pantalla final */
.listen-today { color: var(--muted); margin: 8px 0 0; font-size: .95em; }

/* ===== Dictado palabra por palabra y con huecos ===== */
.dict-diff:empty { display: none; }
.dict-diff { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); }
.dw-line { font-size: 1.12em; font-weight: 800; line-height: 1.7; }
.dw { padding: 1px 4px; border-radius: 6px; }
.dw-ok { color: var(--ok-dark, #3a9b00); background: var(--ok-soft); }
.dw-near { color: #9a6b00; background: #fff3c4; }
.dw-bad { color: var(--bad); background: var(--bad-soft); text-decoration: underline wavy; text-underline-offset: 3px; }
.dw-extra { margin-top: 6px; color: var(--muted); font-size: .9em; }
.dw-note { margin-top: 8px; color: var(--muted); font-size: .92em; }
.cloze-line { font-size: 1.2em; font-weight: 700; line-height: 2.2; text-align: center; margin: 18px 0 0; }
.cloze-gap {
  font: inherit; font-weight: 800; text-align: center; padding: 2px 6px; border: 0; border-bottom: 3px solid var(--primary);
  background: transparent; color: inherit; min-width: 3.5em; border-radius: 6px 6px 0 0;
}
.cloze-gap.ok { border-color: var(--ok); background: var(--ok-soft); }
.cloze-gap.bad { border-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
/* Pares mínimos dentro de las lecciones */
.pair-hint { text-align: center; color: var(--muted); font-size: .92em; margin: -6px 0 12px; }
.pair-kids .emoji-option { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 64px; }
.pair-kids .pk-word { display: none; font-size: 15px; font-weight: 900; }
.pair-kids .revealed .pk-word { display: block; }
.emoji-options.pair-kids { grid-template-columns: repeat(2, 1fr); }

/* ===== Accesibilidad ===== */
.speed-chip.noaudio-on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
/* Foco visible para quien usa teclado o lector de pantalla */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
/* Menos movimiento: sin animaciones ni transiciones largas */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Sin audio: las bocinas no hacen nada, así que no se muestran */
body.no-audio .speaker, body.no-audio .speaker-big, body.no-audio .speaker-slow, body.no-audio .replay,
body.no-audio .speak-mini, body.no-audio #play, body.no-audio #slow, body.no-audio #hear { display: none !important; }
.kid-guest.pulse { border-color: var(--primary); border-style: solid; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }

/* Filas de botones en columna: sin esto, "flex: 1 1 160px" los vuelve gigantes (160 px de alto). */
.btn-row[style*="flex-direction:column"] > .btn, .btn-row[style*="flex-direction: column"] > .btn { flex: none; }
/* Sin scroll de lado: el camino en S y los personajes se salían de la pantalla en celulares angostos.
   "clip" no rompe la barra superior fija (a diferencia de overflow: hidden). */
main#app { overflow-x: clip; }

/* ===== Escuchar primero en conversaciones ===== */
.tap-hint { display: block; font-size: .75em; opacity: .7; margin-top: 4px; }
.ear-bubble, .tutor-chat .bubble.bot { cursor: pointer; }
.bubble .b-en.ear-hidden { display: inline-block; }
/* Escucha y entiende */
.gist-transcript { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); font-size: .95em; }
.gist-transcript p { margin: 6px 0; line-height: 1.45; }
.gist-transcript small { display: block; color: var(--muted); }
.gist-transcript .gt-you b { color: var(--primary); }

/* "Oírme": grabar tu voz y compararla con la voz real */
#mirror.listening { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.mirror-out { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 8px; width: 100%; }

/* Zona de toque de 44 px (lo que pide Apple) sin cambiar cómo se ven los botones pequeños. */
.close-btn, .lr-more, .speak-mini, .replay, .link-btn, .danger-link { position: relative; }
.close-btn::after, .lr-more::after, .speak-mini::after, .replay::after { content: ''; position: absolute; inset: -9px; }
.link-btn::after, .danger-link::after { content: ''; position: absolute; inset: -12px 0; }
