:root{--green:#58cc02;--green-d:#46a302;--blue:#1cb0f6;--red:#ff4b4b;--red-bg:#ffdfe0;--ok-bg:#d7ffb8;--gray:#e5e5e5;--text:#3c3c3c;--muted:#777}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--text);background:#f7f7f7}
a{color:var(--blue);text-decoration:none}
.topbar{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;padding:10px 16px;background:#fff;border-bottom:2px solid var(--gray)}
.logo{font-weight:800;font-size:1.25rem;color:var(--green)}
.topbar nav{display:flex;gap:12px;align-items:center}
.chip{font-weight:700;background:#f1f1f1;padding:4px 10px;border-radius:20px}
.container{max-width:560px;margin:0 auto;padding:16px}
.card{background:#fff;border:2px solid var(--gray);border-radius:16px;padding:16px;margin-bottom:16px}
.form{display:flex;flex-direction:column;gap:12px}
.form label{display:flex;flex-direction:column;gap:4px;font-weight:600}
input{padding:12px;border:2px solid var(--gray);border-radius:12px;font-size:1rem}
input:focus{outline:none;border-color:var(--blue)}
.alert{background:var(--red-bg);color:#b00020;padding:10px;border-radius:10px}
.muted{color:var(--muted)}
.btn{display:inline-block;border:0;border-bottom:4px solid var(--green-d);background:var(--green);color:#fff;font-weight:800;text-transform:uppercase;letter-spacing:.5px;padding:14px 22px;border-radius:14px;cursor:pointer;font-size:1rem;text-align:center}
.btn:active{transform:translateY(2px);border-bottom-width:2px}
.btn-ghost{background:#fff;color:var(--blue);border:2px solid var(--gray);border-bottom-width:4px}
.btn[disabled]{background:var(--gray);border-color:#cfcfcf;color:#aaa;cursor:not-allowed}
.hero{text-align:center;padding:40px 0;display:flex;flex-direction:column;gap:14px;align-items:center}
.hero h1{margin:0;font-size:1.8rem}.owl{font-size:5rem}
.progress{height:14px;background:var(--gray);border-radius:10px;margin:10px 0 6px;overflow:hidden}
.progress>div{height:100%;background:var(--green);border-radius:10px;transition:width .3s}
.unit{margin:24px 0}
.unit-head{background:var(--c);color:#fff;font-weight:800;padding:14px 16px;border-radius:16px}
.path{display:flex;flex-direction:column;gap:18px;padding:20px 0}
.node{display:flex;flex-direction:column;align-items:center;gap:6px}
.node.left{transform:translateX(-40px)}.node.right{transform:translateX(40px)}
.circle{width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.8rem;color:#fff;border-bottom:6px solid rgba(0,0,0,.2)}
.circle.done{background:#ffc800}.circle.current{background:var(--green);animation:pulse 1.6s infinite}.circle.locked{background:var(--gray);color:#aaa}
.node-title{text-align:center;font-weight:700;font-size:.9rem}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(88,204,2,.5)}50%{box-shadow:0 0 0 14px rgba(88,204,2,0)}}
.rank{list-style:none;padding:0;margin:0 0 12px}
.rank li{display:flex;justify-content:space-between;padding:10px;border-bottom:1px solid var(--gray)}
.rank li.me{background:var(--ok-bg);border-radius:8px;font-weight:700}

/* ---- Pantalla de lección ---- */
.lesson-page{background:#fff}
.l-wrap{max-width:600px;margin:0 auto;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;padding:16px}
.l-top{display:flex;align-items:center;gap:12px}
.l-close{font-size:1.5rem;color:var(--muted);cursor:pointer;background:none;border:0}
.l-bar{flex:1;height:16px;background:var(--gray);border-radius:10px;overflow:hidden}
.l-bar>div{height:100%;background:var(--green);transition:width .3s}
.l-hearts{font-weight:800;color:var(--red)}
.l-body{flex:1;padding:24px 0}
.l-body h2{margin:0 0 20px;font-size:1.4rem}
.speak{font-size:2.4rem;background:var(--blue);border:0;border-bottom:5px solid #1899d6;border-radius:18px;width:90px;height:90px;cursor:pointer;color:#fff}
.options{display:grid;gap:10px}
.opt{padding:14px;border:2px solid var(--gray);border-bottom-width:4px;border-radius:14px;background:#fff;font-size:1.05rem;cursor:pointer;text-align:left}
.opt.sel{border-color:var(--blue);background:#ddf4ff}
.answer-line{min-height:64px;border-top:2px solid var(--gray);border-bottom:2px solid var(--gray);padding:10px 0;display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}
.bank{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.word{padding:10px 14px;border:2px solid var(--gray);border-bottom-width:4px;border-radius:12px;background:#fff;font-size:1.05rem;cursor:pointer}
.word.used{visibility:hidden}
.l-input{width:100%;margin-top:20px;font-size:1.1rem}
.l-foot{position:sticky;bottom:0;z-index:5;background:#fff;margin:0 -16px -16px;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom, 0px));border-top:2px solid var(--gray)}
.l-foot.ok{background:var(--ok-bg);border-color:var(--ok-bg)}
.l-foot.bad{background:var(--red-bg);border-color:var(--red-bg)}
.l-foot .msg{font-weight:800;margin-bottom:10px}
.l-foot.ok .msg{color:#58a700}.l-foot.bad .msg{color:#d33}
.l-foot .btn{width:100%}
.l-foot.bad .btn{background:var(--red);border-bottom-color:#d33}
.result{text-align:center;padding-top:60px}
.result .big{font-size:5rem}
.stats{display:flex;gap:12px;justify-content:center;margin:20px 0}
.stat{border:2px solid var(--gray);border-radius:14px;padding:12px 20px;font-weight:800}

/* ---- Robot Nova (diseño moderno) ---- */
.robot-card{text-align:center}
.robot{width:190px;height:214px;overflow:visible}
.robot .nv-float{animation:nvFloat 4.2s ease-in-out infinite}
.robot .nv-shadow{transform-box:fill-box;transform-origin:center;animation:nvShadow 4.2s ease-in-out infinite}
.robot .nv-halo{animation:nvHalo 3s ease-in-out infinite alternate}
.robot .nv-eye{transform-box:fill-box;transform-origin:center}
.robot.idle .nv-eye{animation:nvBlink 5s infinite}
.robot .nv-bars rect{fill:#22e5ff;transform-box:fill-box;transform-origin:center;transform:scaleY(.22)}
.robot.talking .nv-bars rect{animation:nvEq .45s ease-in-out infinite alternate}
.robot.talking .nv-bars rect:nth-child(2){animation-delay:.08s}
.robot.talking .nv-bars rect:nth-child(3){animation-delay:.16s}
.robot.talking .nv-bars rect:nth-child(4){animation-delay:.05s}
.robot.talking .nv-bars rect:nth-child(5){animation-delay:.12s}
.robot.talking .nv-core{animation:nvCore .5s ease-in-out infinite alternate}
.robot.listening .nv-eye{fill:#3dff8b;animation:nvListen .8s ease-in-out infinite alternate}
.robot.listening .nv-halo{stroke:#3dff8b}
.robot.listening .nv-bars rect{fill:#3dff8b}
.robot.bad .nv-eye{fill:#ff5b6e}
.robot.bad .nv-halo{stroke:#ff5b6e}
@keyframes nvFloat{50%{transform:translateY(-7px)}}
@keyframes nvShadow{50%{transform:scale(.88);opacity:.12}}
@keyframes nvHalo{from{opacity:.55}to{opacity:1}}
@keyframes nvBlink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.08)}}
@keyframes nvEq{from{transform:scaleY(.25)}to{transform:scaleY(1.6)}}
@keyframes nvCore{from{opacity:.65}to{opacity:1}}
@keyframes nvListen{from{transform:scale(1)}to{transform:scale(1.18)}}
.bubble{background:#f1f9ff;border:2px solid #bfe6fb;border-radius:16px;padding:12px;font-weight:600;margin-top:6px}
.status{min-height:20px;color:var(--muted);font-size:.85rem;margin-top:6px}
.level-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.level-tabs button{flex:1;min-width:80px;padding:10px;border:2px solid var(--gray);border-bottom-width:4px;border-radius:12px;background:#fff;font-weight:800;cursor:pointer}
.level-tabs button.on{border-color:var(--blue);background:#ddf4ff;color:var(--blue)}
.actions{display:flex;gap:10px;margin:12px 0}
.actions .btn{flex:1}
.heard{font-size:1.05rem;margin:10px 0}
.feedback{margin:10px 0;font-weight:600}
.w-ok{color:#46a302;font-weight:800}.w-miss{color:#d33;text-decoration:underline;font-weight:800}
.tipbox{background:#fff7e0;border-radius:12px;padding:10px;margin-top:8px;font-weight:500}
.lvl{float:right;background:rgba(255,255,255,.3);padding:2px 10px;border-radius:10px;font-size:.85rem}
.vocab{display:grid;gap:10px}
.vcard{display:flex;justify-content:space-between;align-items:center;border:2px solid var(--gray);border-bottom-width:4px;border-radius:14px;padding:12px 14px;font-size:1.05rem}
.vsp{font-size:1.4rem;background:var(--blue);border:0;border-radius:12px;width:46px;height:46px;color:#fff;cursor:pointer}
.robot-link{display:block;text-align:center;font-weight:800;padding:12px;border-radius:14px;background:#ddf4ff;border:2px solid #bfe6fb;color:var(--blue)}
.robot-link.locked{background:#f1f1f1;border-color:var(--gray);color:#aaa}

/* ---- Entrenador de vocabulario ---- */
.topics{display:grid;gap:10px;margin-top:12px}
.topic{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:14px;border:2px solid var(--gray);border-bottom-width:4px;border-radius:14px;background:#fff;font-size:1rem;font-weight:700;cursor:pointer;text-align:left;width:100%}
.topic span{background:#f1f1f1;border-radius:10px;padding:2px 10px;font-size:.85rem;color:var(--muted)}
.topic.weak{border-color:#ffb3b3;background:#fff5f5;margin-top:12px}
.modes{display:grid;gap:12px}
.mode{padding:18px;border:2px solid var(--gray);border-bottom-width:4px;border-radius:16px;background:#fff;font-size:1.1rem;font-weight:800;text-align:left;cursor:pointer}
.mode small{display:block;font-weight:500;color:var(--muted);margin-top:4px;font-size:.85rem}
.wordcard{text-align:center;margin:18px 0}.wordcard .en{font-size:2.2rem;font-weight:800}
.match{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mcol{display:flex;flex-direction:column;gap:10px}
.mcard{padding:14px 8px;border:2px solid var(--gray);border-bottom-width:4px;border-radius:14px;background:#fff;font-size:1rem;cursor:pointer;word-break:break-word}
.mcard.sel{border-color:var(--blue);background:#ddf4ff}
.mcard.done{background:var(--ok-bg);border-color:#b7e48a;color:#46a302;pointer-events:none;opacity:.75}
.mcard.bad{animation:shake .4s;border-color:var(--red);background:var(--red-bg)}
@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.opt.good{border-color:#58cc02;background:var(--ok-bg)}
.opt.wrong{border-color:var(--red);background:var(--red-bg)}
.vocab-link{display:block;text-align:center;font-weight:800;padding:12px;margin-top:12px;border-radius:14px;background:#fff7e0;border:2px solid #ffe29a;color:#b57b00}

/* ---- Alertas, planes y chat ---- */
.alert.ok{background:#e6f9d5;color:#2d6a00}
.plans{display:grid;gap:14px;margin-top:12px}
@media(min-width:640px){.plans{grid-template-columns:1fr 1fr}}
.plan{position:relative}
.plan h3{margin:0 0 6px}
.plan .price{font-size:2rem;font-weight:800}
.plan .price small{font-size:.9rem;font-weight:600;color:var(--muted)}
.plan ul{list-style:none;padding:0;margin:12px 0;display:grid;gap:8px}
.plan.featured{border-color:#8b5cff;box-shadow:0 6px 24px rgba(139,92,255,.18)}
.plan .badge{position:absolute;top:-12px;right:14px;background:linear-gradient(90deg,#22e5ff,#8b5cff);color:#fff;font-weight:800;font-size:.75rem;padding:4px 12px;border-radius:12px}
.plan-form{display:grid;gap:10px}
.chat-hero{text-align:center}
.usage{font-size:.85rem;color:var(--muted);margin-top:4px}
.chat-controls{display:grid;gap:10px}
.chat-controls label{display:flex;flex-direction:column;gap:4px;font-weight:600}
.chat-controls select{padding:12px;border:2px solid var(--gray);border-radius:12px;font-size:1rem;background:#fff}
.chat-log{display:flex;flex-direction:column;gap:10px;padding-bottom:14px}
.msg{max-width:88%;padding:10px 14px;border-radius:18px;line-height:1.4}
.msg.bot{align-self:flex-start;background:#f1f1f4;border-bottom-left-radius:6px}
.msg.user{align-self:flex-end;background:#e6e0ff;border-bottom-right-radius:6px}
.msg .typing{opacity:.6}
.msg .fix{margin-top:8px;padding:8px 10px;background:#fff8e1;border-radius:10px;font-size:.92rem}
.msg .why{margin-top:4px;color:#6b5b00;font-weight:500}
.msg .tip{margin-top:8px;font-size:.88rem;color:#3a5a99}
.msg .replay{border:0;background:none;cursor:pointer;font-size:1rem;margin-left:6px}
.note{align-self:center;text-align:center;font-size:.85rem;color:var(--muted);background:#fff7e0;border-radius:12px;padding:8px 12px}
.chat-form{position:sticky;bottom:0;z-index:5;display:flex;gap:8px;align-items:center;background:#fff;border-top:2px solid var(--gray);margin:0 -16px -16px;padding:12px 16px;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.chat-form input{flex:1;min-width:0}
.mic{width:48px;height:48px;border:0;border-radius:50%;background:linear-gradient(135deg,#22e5ff,#8b5cff);color:#fff;font-size:1.3rem;cursor:pointer;flex:none}
.mic[disabled]{opacity:.4}
.mic.on{animation:nvListen .8s ease-in-out infinite alternate;background:#3dff8b}

/* ---- Albert, niveles, tokens, anuncios y práctica extra ---- */
.albert-avatar{width:64px;height:64px;flex:none}
.albert-hero{display:flex;align-items:center;gap:14px;padding:16px;margin-bottom:16px;border-radius:22px;color:#fff;background:linear-gradient(135deg,#1d2145 0%,#3b2a8f 55%,#7c5cff 100%);box-shadow:0 10px 28px rgba(92,70,200,.35);position:relative;overflow:hidden}
.albert-hero::after{content:"";position:absolute;right:-30px;top:-30px;width:130px;height:130px;border-radius:50%;background:radial-gradient(circle,rgba(34,229,255,.35),rgba(34,229,255,0) 70%)}
.albert-hero .albert-avatar{width:72px;height:72px}
.ah-text{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
.ah-text strong{font-size:1.2rem}
.ah-text small{opacity:.85}
.ah-badge{align-self:flex-start;font-size:.68rem;font-weight:800;letter-spacing:.5px;padding:2px 9px;border-radius:10px;background:linear-gradient(90deg,#22e5ff,#8b5cff);color:#fff}
.ah-go{font-size:1.6rem;font-weight:800;z-index:1}
.card.feature{display:flex;gap:12px;align-items:center;color:inherit}
.card.feature .albert-avatar{width:52px;height:52px}
.feat-ico{font-size:2.2rem;width:52px;text-align:center;flex:none}
.level-nav{display:flex;gap:8px;overflow-x:auto;padding:4px 0 10px;margin:4px 0 6px;-webkit-overflow-scrolling:touch}
.level-nav .lv{flex:none;padding:9px 16px;border-radius:14px;border:2px solid var(--gray);border-bottom-width:4px;background:#fff;font-weight:800;color:var(--text)}
.level-nav .lv.on{border-color:var(--blue);background:#ddf4ff;color:var(--blue)}
.level-nav .lv.locked{opacity:.5}
.tok-card{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between}
.tok-main{display:flex;gap:12px;align-items:center}
.tok-coin{font-size:2rem}
.tok-actions{display:flex;gap:8px;flex-wrap:wrap}
.tok-actions .btn{padding:10px 14px;font-size:.85rem}
.tok-chip{font-weight:800;background:#fff7e0;border-radius:12px;padding:3px 10px;font-size:.9rem}
.sfx-btn{border:0;background:none;font-size:1.2rem;cursor:pointer;padding:4px}
.extras{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:4px 0 12px;padding:10px;border:2px dashed var(--gray);border-radius:14px}
.extras-title{width:100%;font-weight:800;font-size:.9rem}
.xlesson{padding:8px 12px;border-radius:12px;background:#eef6ff;border:2px solid #bfe0fb;font-weight:700;font-size:.85rem;color:#1478b5}
.xlesson.done{background:#e6f9d5;border-color:#b7e48a;color:#46a302}
.xlesson.locked{background:#f1f1f1;border-color:var(--gray);color:#aaa}
.ad-overlay{position:fixed;inset:0;z-index:50;background:rgba(10,12,30,.65);display:flex;align-items:center;justify-content:center;padding:16px}
.ad-box{background:#fff;border-radius:20px;padding:18px;width:100%;max-width:420px;text-align:center}
.ad-slot{height:250px;border-radius:14px;overflow:hidden;background:#f3f3f3;display:flex;align-items:center;justify-content:center;margin:10px 0}
.ad-frame{width:100%;height:100%;border:0}
.ad-count{font-weight:700;margin-bottom:10px;min-height:22px}
.ad-banner{margin:16px 0;text-align:center}

@media(min-width:760px){.plans3{grid-template-columns:repeat(3,1fr)}}
