/* Gōngfu — una columna para el teléfono. Tinta + sello rojo como identidad; los 4 colores de tono son el único sistema multicolor. */
:root{
  --bg:#F3F4F1; --surface:#FFFFFF; --surface-2:#ECEEE9; --surface-3:#E1E4DE; --ink:#16181D; --ink-2:#2B2F36; --muted:#5F656D; --line:#DDE0DA;
  --seal:#D2392A; --seal-ink:#FFFFFF; --seal-soft:#FBE4DF;
  --jade:#12805B; --jade-soft:#D8EFE5; --gold:#D99606; --gold-soft:#FBEFCF;
  --ok:#12805B; --ok-soft:#DDF2E8; --bad:#C9372A; --bad-soft:#FCE4E0;
  --t1:#E0443F; --t2:#DB8A07; --t3:#249157; --t4:#3561D6; --t0:#8B9097;
  --btn:#16181D; --btn-ink:#FFFFFF; --btn-edge:#000000;
  --shadow:0 1px 2px rgba(22,24,29,.05),0 6px 20px rgba(22,24,29,.06);
  --f-display:"Bricolage Grotesque",ui-sans-serif,system-ui,sans-serif;
  --f-body:"Figtree",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --f-hz:"PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Noto Sans SC","Source Han Sans SC","Microsoft YaHei",sans-serif;
  --f-brush:"Ma Shan Zheng","Kaiti SC","STKaiti","KaiTi",serif;
  --r:20px; --tabs-h:68px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#121316; --surface:#1B1D21; --surface-2:#24272C; --surface-3:#2E3238; --ink:#ECEDEF; --ink-2:#D4D6DA; --muted:#9AA0A8; --line:#2C3036;
  --seal:#F0553F; --seal-ink:#FFFFFF; --seal-soft:#3A1E1A;
  --jade:#3CC492; --jade-soft:#14362A; --gold:#F2B83A; --gold-soft:#3A2F10;
  --ok:#3CC492; --ok-soft:#163A2D; --bad:#F26B5F; --bad-soft:#3E1F1C;
  --t1:#F2665E; --t2:#F2A93B; --t3:#45C27D; --t4:#7A9BF5; --t0:#8E949B;
  --btn:#ECEDEF; --btn-ink:#121316; --btn-edge:#9AA0A8;
  --shadow:0 1px 2px rgba(0,0,0,.35),0 8px 24px rgba(0,0,0,.25); color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#121316; --surface:#1B1D21; --surface-2:#24272C; --surface-3:#2E3238; --ink:#ECEDEF; --ink-2:#D4D6DA; --muted:#9AA0A8; --line:#2C3036;
  --seal:#F0553F; --seal-ink:#FFFFFF; --seal-soft:#3A1E1A;
  --jade:#3CC492; --jade-soft:#14362A; --gold:#F2B83A; --gold-soft:#3A2F10;
  --ok:#3CC492; --ok-soft:#163A2D; --bad:#F26B5F; --bad-soft:#3E1F1C;
  --t1:#F2665E; --t2:#F2A93B; --t3:#45C27D; --t4:#7A9BF5; --t0:#8E949B;
  --btn:#ECEDEF; --btn-ink:#121316; --btn-edge:#9AA0A8;
  --shadow:0 1px 2px rgba(0,0,0,.35),0 8px 24px rgba(0,0,0,.25); color-scheme:dark}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.45;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;padding:0}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--t4);outline-offset:2px}
h1,h2,h3{font-family:var(--f-display);margin:0;letter-spacing:-.015em;text-wrap:balance;font-weight:800}
p{margin:0}
[hidden]{display:none!important}
.hz{font-family:var(--f-hz);font-weight:500}
.brush{font-family:var(--f-brush);font-weight:400}
.muted{color:var(--muted)} .small{font-size:14px} .tiny{font-size:12px}
.eyebrow{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.t1{color:var(--t1)}.t2{color:var(--t2)}.t3{color:var(--t3)}.t4{color:var(--t4)}.t0{color:var(--t0)}
.nums{font-variant-numeric:tabular-nums}

/* ---------- Estructura ---------- */
.app{max-width:540px;margin:0 auto;padding-inline:16px;padding-block:calc(8px + env(safe-area-inset-top,0px)) calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom,0px))}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:6px 14px}
.brand{display:flex;align-items:center;gap:10px}
.logo{width:38px;height:38px;border-radius:10px;background:var(--seal);color:var(--seal-ink);display:grid;place-items:center;font-family:var(--f-brush);font-size:27px;line-height:1;transform:rotate(-5deg);box-shadow:inset 0 0 0 2px rgba(255,255,255,.25)}
.brand-name{font-family:var(--f-display);font-weight:800;font-size:22px;letter-spacing:-.02em}
.pills{display:flex;gap:8px}
.pill{display:inline-flex;align-items:center;gap:6px;height:36px;padding-inline:12px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-weight:800;font-size:15px;font-variant-numeric:tabular-nums}
.pill svg{width:18px;height:18px}
.pill.streak svg{color:var(--gold)} .pill.streak.off svg{color:var(--muted)}
.hz-mini{font-family:var(--f-brush);font-size:16px;color:var(--seal);font-weight:400}
.bump{animation:bump .5s ease}
@keyframes bump{40%{transform:scale(1.18)}}
.view{display:none;flex-direction:column;gap:14px}
.view.active{display:flex;animation:enter .3s ease both}
@keyframes enter{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:none}}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px;box-shadow:var(--shadow);min-width:0}
.card h3{font-size:19px}
.row{display:flex;align-items:center;gap:12px}
.between{display:flex;align-items:center;justify-content:space-between;gap:12px}
.stack{display:flex;flex-direction:column;gap:10px}
.sec-title{font-size:28px;line-height:1.1}

/* ---------- Botones ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:52px;padding:12px 20px;border-radius:16px;font-weight:800;font-size:17px;letter-spacing:.005em;transition:transform .08s ease,box-shadow .08s ease,opacity .2s;text-align:center;user-select:none;-webkit-user-select:none}
.btn.primary{background:var(--btn);color:var(--btn-ink);box-shadow:0 4px 0 var(--btn-edge)}
.btn.primary:active{transform:translateY(3px);box-shadow:0 1px 0 var(--btn-edge)}
.btn.seal{background:var(--seal);color:var(--seal-ink);box-shadow:0 4px 0 color-mix(in srgb,var(--seal) 60%,#000)}
.btn.seal:active{transform:translateY(3px);box-shadow:0 1px 0 color-mix(in srgb,var(--seal) 60%,#000)}
.btn.ok{background:var(--ok);color:#fff;box-shadow:0 4px 0 color-mix(in srgb,var(--ok) 60%,#000)}
.btn.ok:active{transform:translateY(3px);box-shadow:0 1px 0 color-mix(in srgb,var(--ok) 60%,#000)}
.btn.bad{background:var(--bad);color:#fff;box-shadow:0 4px 0 color-mix(in srgb,var(--bad) 60%,#000)}
.btn.ghost{background:var(--surface-2);color:var(--ink)}
.btn.ghost:active{transform:scale(.98)}
.btn.line{background:transparent;border:2px solid var(--line);color:var(--ink)}
.btn.block{width:100%}
a.btn{text-decoration:none}
.btn[disabled]{opacity:.38;pointer-events:none;box-shadow:none}
.btn svg{width:22px;height:22px}
.btn-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.icon-btn{width:48px;height:48px;border-radius:14px;background:var(--surface-2);display:grid;place-items:center;flex:none}
.icon-btn svg{width:24px;height:24px}
.link{color:var(--muted);font-size:14px;text-decoration:underline;padding:8px}
.chip{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--surface-2);white-space:nowrap}
.chip.gold{background:var(--gold-soft)} .chip.ok{background:var(--ok-soft);color:var(--ok)} .chip.seal{background:var(--seal-soft);color:var(--seal)}

/* ---------- Hoy ---------- */
.greet .zh{font-family:var(--f-hz);font-weight:700;font-size:15px;color:var(--seal)}
.greet h1{font-size:32px;line-height:1.05;margin-top:2px}
.today{position:relative;overflow:hidden}
.today .ring{width:64px;height:64px;flex:none}
.ring circle{fill:none;stroke-width:7}
.ring .bg{stroke:var(--surface-2)} .ring .fg{stroke:var(--jade);stroke-linecap:round;transition:stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1)}
.ring text{font-family:var(--f-display);font-weight:800;font-size:17px;fill:var(--ink)}
.steps{display:flex;flex-direction:column;gap:8px;margin-block:14px 16px}
.step{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:14px;background:var(--surface-2)}
.step .num{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:14px;background:var(--surface);border:1.5px solid var(--line);flex:none}
.step.done .num{background:var(--jade);border-color:var(--jade);color:#fff}
.step .st-t{font-weight:700;line-height:1.2} .step .st-d{font-size:13px;color:var(--muted)}
.step .min{margin-left:auto;font-size:13px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.done-banner{display:flex;align-items:center;gap:14px;padding:12px;border-radius:14px;background:var(--ok-soft);margin-block:12px}
.done-banner .stamp{width:52px;height:52px;font-size:34px}
/* calendario de sellos */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-top:12px}
.cal .dow{font-size:11px;font-weight:800;color:var(--muted);text-align:center}
.brush-nw{white-space:nowrap}
.cal .d{aspect-ratio:1;border-radius:10px;background:var(--surface-2);display:grid;place-items:center;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;position:relative}
.cal .d.future{background:transparent;border:1px dashed var(--line)}
.cal .d.today{box-shadow:inset 0 0 0 2px var(--ink)}
.stamp{width:100%;height:100%;border-radius:9px;background:var(--seal);color:var(--seal-ink);display:grid;place-items:center;font-family:var(--f-brush);font-size:clamp(18px,6vw,28px);line-height:1;box-shadow:inset 0 0 0 2px rgba(255,255,255,.22)}
.stamp.new{animation:stampin .7s cubic-bezier(.2,1.4,.4,1) both}
@keyframes stampin{0%{transform:scale(2.4) rotate(-20deg);opacity:0}60%{transform:scale(.92) rotate(var(--rot,0deg));opacity:1}100%{transform:scale(1) rotate(var(--rot,0deg))}}
.lvl-card .bar{height:10px;border-radius:9px;background:var(--surface-2);overflow:hidden;margin-top:10px}
.bar>i{display:block;height:100%;width:0;background:var(--jade);border-radius:9px;transition:width .9s cubic-bezier(.2,.8,.2,1)}
.lvl-watermark{position:absolute;right:-6px;top:-18px;font-family:var(--f-brush);font-size:110px;line-height:1;color:var(--ink);opacity:.05;pointer-events:none}
.wotd{display:flex;align-items:center;gap:16px}
.wotd .glyph{font-family:var(--f-hz);font-weight:700;font-size:54px;line-height:1;white-space:nowrap;min-width:84px;height:84px;padding-inline:10px;display:grid;place-items:center;border-radius:16px;background:var(--surface-2)}
.wotd .py{font-family:var(--f-display);font-weight:800;font-size:22px}

/* ---------- Lecciones ---------- */
.level{position:relative;overflow:hidden}
.level .lvl-zh{white-space:nowrap;position:absolute;right:12px;top:4px;font-family:var(--f-brush);font-size:64px;line-height:1;opacity:.09;pointer-events:none}
.path{display:flex;flex-direction:column;margin-top:14px;position:relative}
.node{display:flex;align-items:center;gap:14px;padding:10px 4px;text-align:left;width:100%;position:relative;border-radius:14px}
.node:active{background:var(--surface-2)}
.node .dot{width:46px;height:46px;border-radius:50%;flex:none;display:grid;place-items:center;font-weight:800;font-size:14px;background:var(--surface-2);color:var(--muted);position:relative;z-index:1;font-variant-numeric:tabular-nums}
.node.done .dot{background:var(--jade);color:#fff}
.node.next .dot{background:var(--seal);color:#fff;box-shadow:0 0 0 5px var(--seal-soft)}
.node.next .dot::after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid var(--seal);animation:pulse 1.8s ease-out infinite}
@keyframes pulse{from{transform:scale(1);opacity:.8}to{transform:scale(1.35);opacity:0}}
.node.lock{opacity:.55}
.node .dot svg{width:20px;height:20px}
.node .n-t{font-weight:800;line-height:1.2} .node .n-d{font-size:13px;color:var(--muted)}
.node .n-r{margin-left:auto}
.path .node:not(:last-child)::before{content:"";position:absolute;left:26px;top:52px;height:calc(100% - 42px);width:2px;background:var(--line)}
.soon{border-style:dashed;box-shadow:none;background:transparent}

/* ---------- Práctica ---------- */
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;box-shadow:var(--shadow);text-align:left;display:flex;flex-direction:column;gap:6px;min-height:132px;position:relative;overflow:hidden;transition:transform .1s}
.tile:active{transform:scale(.97)}
.tile .t-hz{font-family:var(--f-brush);font-size:38px;line-height:1;color:var(--seal)}
.tile b{font-size:17px} .tile span.d{font-size:13px;color:var(--muted);line-height:1.3}
.tile .badge{position:absolute;top:12px;right:12px}
.chars-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px}
.cg{aspect-ratio:1;border-radius:14px;background:var(--surface-2);display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:var(--f-hz);font-size:30px;font-weight:500;position:relative}
.cg small{font-family:var(--f-body);font-size:11px;color:var(--muted)}
.cg.m::after{content:"";position:absolute;top:7px;right:7px;width:8px;height:8px;border-radius:50%;background:var(--ok)}
.cg.lock{opacity:.35}
.scen{display:flex;gap:12px;align-items:flex-start;text-align:left;width:100%;padding:14px;border-radius:16px;background:var(--surface-2)}
.scen .s-hz{font-family:var(--f-brush);font-size:30px;color:var(--seal);line-height:1;min-width:34px}
.scen b{display:block;color:var(--ink)} .scen span{font-size:13px;color:var(--muted)}
.scen[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--ink);background:var(--surface)}

/* ---------- Progreso ---------- */
.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px 16px}
.stat .v{font-family:var(--f-display);font-weight:800;font-size:30px;line-height:1.05;font-variant-numeric:tabular-nums}
.stat .k{font-size:13px;color:var(--muted)}
.chart{width:100%;height:auto;display:block;margin-top:10px}
.chart .b{fill:var(--jade)} .chart .b.today{fill:var(--seal)}
.chart .ax{fill:var(--muted);font-size:11px;font-family:var(--f-body);font-weight:700}
.chart .val{fill:var(--ink);font-size:11px;font-weight:800;font-family:var(--f-body)}
.chart .goal{stroke:var(--muted);stroke-dasharray:4 4;stroke-width:1}
.chart .base{stroke:var(--line);stroke-width:1}
.deck{display:flex;flex-direction:column;max-height:340px;overflow-y:auto;margin-top:8px;border-radius:12px}
.deck .w{display:flex;align-items:center;gap:12px;padding:9px 4px;border-bottom:1px solid var(--line)}
.deck .w:last-child{border-bottom:0}
.deck .w .hz{font-size:22px;min-width:76px}
.deck .w .m{font-size:13px;color:var(--muted);flex:1;min-width:0}
.strength{display:flex;gap:3px}
.strength i{width:6px;height:16px;border-radius:3px;background:var(--surface-3)}
.strength i.on{background:var(--jade)}
details.box{border-top:1px solid var(--line);padding-block:12px}
details.box:first-of-type{border-top:0;padding-top:4px}
details.box summary{font-weight:800;cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:32px}
details.box summary::-webkit-details-marker{display:none}
details.box summary::after{content:"+";font-weight:800;color:var(--muted);font-size:20px}
details.box[open] summary::after{content:"–"}
details.box .inner{margin-top:10px;display:flex;flex-direction:column;gap:10px;font-size:14px;color:var(--muted)}
textarea,input[type="time"],input[type="text"]{width:100%;font:inherit;font-size:16px;padding:12px 14px;border-radius:14px;border:2px solid var(--line);background:var(--surface);color:var(--ink)}
textarea{min-height:90px;font-family:ui-monospace,Menlo,monospace;font-size:12px}
.credits{font-size:12px;color:var(--muted);text-align:center;padding-inline:8px}
.credits a{color:inherit}

/* ---------- Tabs ---------- */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px))}
.tabs-in{max-width:540px;margin:0 auto;display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.tab{display:flex;flex-direction:column;align-items:center;gap:1px;padding:6px 0;border-radius:14px;color:var(--muted);font-size:12px;font-weight:800;min-height:54px;justify-content:center}
.tab-hz{font-family:var(--f-brush);font-size:24px;line-height:1}
.tab[aria-current="page"]{color:var(--ink);background:var(--surface-2)}
.tab[aria-current="page"] .tab-hz{color:var(--seal)}
body.in-player .tabs,body.in-player .app{display:none}

/* ---------- Reproductor de actividades ---------- */
.player{position:fixed;inset:0;z-index:40;background:var(--bg);display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px)}
.player>*{width:100%;max-width:540px;margin-inline:auto}
.p-top{display:flex;align-items:center;gap:12px;padding:10px 16px 4px}
.p-close{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;color:var(--muted);flex:none}
.p-close svg{width:24px;height:24px}
.p-bar{flex:1;height:14px;border-radius:9px;background:var(--surface-3);overflow:hidden}
.p-bar i{display:block;height:100%;width:0;background:var(--jade);border-radius:9px;transition:width .45s cubic-bezier(.2,.8,.2,1);box-shadow:inset 0 -4px 0 rgba(0,0,0,.08)}
.p-speed{height:36px;min-width:52px;padding-inline:10px;border-radius:10px;background:var(--surface-2);font-weight:800;font-size:13px;font-variant-numeric:tabular-nums}
.p-speed[aria-pressed="true"]{background:var(--gold-soft)}
.p-title{padding:4px 16px 0;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);min-height:20px}
.p-stage{flex:1;overflow-y:auto;padding:12px 16px 24px;display:flex;flex-direction:column;gap:14px;-webkit-overflow-scrolling:touch}
.p-stage>*{animation:enter .28s ease both;flex-shrink:0}
.p-foot{padding:12px 16px calc(14px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:var(--bg);display:flex;flex-direction:column;gap:10px}
.p-foot:empty{display:none}
.q{font-family:var(--f-display);font-weight:800;font-size:23px;line-height:1.2}
.q-sub{color:var(--muted);font-size:15px;margin-top:-6px}

/* hoja de respuesta */
.sheet{position:absolute;left:0;right:0;bottom:0;margin:0 auto;max-width:540px;padding:18px 16px calc(16px + env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0;display:flex;flex-direction:column;gap:12px;animation:sheetup .28s cubic-bezier(.2,.9,.3,1.1) both;z-index:5}
.sheet.ok{background:var(--ok-soft)} .sheet.bad{background:var(--bad-soft)} .sheet.neutral{background:var(--surface-2)}
@keyframes sheetup{from{transform:translateY(100%)}to{transform:none}}
.sheet .s-head{display:flex;align-items:center;gap:10px;font-family:var(--f-display);font-weight:800;font-size:22px}
.sheet.ok .s-head{color:var(--ok)} .sheet.bad .s-head{color:var(--bad)}
.sheet .s-head .ic{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:#fff;flex:none}
.sheet.ok .ic{background:var(--ok)} .sheet.bad .ic{background:var(--bad)}
.sheet .ic svg{width:20px;height:20px}
.sheet .s-body{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.sheet .s-hz{font-family:var(--f-hz);font-weight:700;font-size:36px;line-height:1.1}
.sheet .s-py{font-family:var(--f-display);font-weight:800;font-size:19px}
.sheet .s-why{font-size:14px;color:var(--ink-2)}

/* opciones */
.opts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.opts.one{grid-template-columns:1fr}
.opt{border:2px solid var(--line);border-bottom-width:4px;border-radius:16px;padding:12px 14px;background:var(--surface);display:flex;align-items:center;gap:10px;text-align:left;min-height:62px;transition:transform .08s,border-color .15s,background .15s;font-weight:700;font-size:17px}
.opt:active{transform:translateY(2px);border-bottom-width:2px}
.opt.sel{border-color:var(--t4);background:color-mix(in srgb,var(--t4) 8%,var(--surface))}
.opt.right{border-color:var(--ok);background:var(--ok-soft);animation:pop .35s ease}
.opt.wrong{border-color:var(--bad);background:var(--bad-soft);animation:shake .35s ease}
.opt[disabled]{cursor:default}
.opt .cv{width:58px;flex:none;display:flex;gap:3px}
.opt .cv.two{width:84px}
.opt .o-sub{display:block;font-size:12px;font-weight:600;color:var(--muted)}
.opt .o-hz{font-family:var(--f-hz);font-size:22px;font-weight:700}
@keyframes pop{50%{transform:scale(1.04)}}
@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}

/* botón de audio grande */
.orb-wrap{display:flex;flex-direction:column;align-items:center;gap:8px;padding-block:10px}
.orb{width:112px;height:112px;border-radius:50%;background:var(--t4);color:#fff;display:grid;place-items:center;position:relative;box-shadow:0 6px 0 color-mix(in srgb,var(--t4) 60%,#000);transition:transform .08s,box-shadow .08s}
.orb:active{transform:translateY(4px);box-shadow:0 2px 0 color-mix(in srgb,var(--t4) 60%,#000)}
.orb svg{width:46px;height:46px}
.orb.playing::before,.orb.playing::after{content:"";position:absolute;inset:0;border-radius:50%;border:3px solid var(--t4);animation:ring 1.2s ease-out infinite}
.orb.playing::after{animation-delay:.4s}
@keyframes ring{from{transform:scale(1);opacity:.7}to{transform:scale(1.55);opacity:0}}
.orb-row{display:flex;gap:10px;justify-content:center}
.mini-play{display:inline-flex;align-items:center;gap:6px;height:40px;padding-inline:14px;border-radius:12px;background:var(--surface-2);font-weight:800;font-size:14px}
.mini-play svg{width:18px;height:18px}

/* tarjetas de tono */
.tone-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tone{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;text-align:left;display:flex;flex-direction:column;gap:4px;transition:transform .12s}
.tone:active{transform:scale(.97)}
.tone .tt{display:flex;justify-content:space-between;align-items:baseline}
.tone .ts{font-family:var(--f-display);font-size:26px;font-weight:800}
.tone .tn{font-size:11px;font-weight:800;color:var(--muted)}
.tone .tl{font-size:13px;color:var(--muted)}
.contour{width:100%;height:auto;display:block}
.contour .staff{stroke:var(--line);stroke-width:1}
.contour .lbl{fill:var(--muted);font-size:8px;font-family:var(--f-body);font-weight:700}
.contour .path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.tone.play .path{animation:draw .55s ease both}
@keyframes draw{from{stroke-dashoffset:200}to{stroke-dashoffset:0}}

/* info */
.info{display:flex;flex-direction:column;gap:12px;font-size:17px}
.info h2{font-size:26px;line-height:1.15}
.info p{line-height:1.5}
.info .small{font-size:14px;color:var(--muted)}
.big-hz{font-family:var(--f-hz);font-weight:700;font-size:30px;color:var(--seal);vertical-align:-4px;margin-right:2px}
.rules{padding-left:22px;margin:0;display:flex;flex-direction:column;gap:14px}
.rules li b{display:block;margin-bottom:8px}
.say-list{display:flex;flex-direction:column;gap:8px}
.say{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);text-align:left;width:100%}
.say .hz{font-size:24px;font-weight:700}
.say .sp{font-size:14px;color:var(--muted)}
.say svg{width:22px;height:22px;color:var(--t4);flex:none;margin-left:auto}
.stypes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stype{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:8px;text-align:center}
.stype svg{width:46px;height:46px;display:block;margin:0 auto}
.stype path{fill:none;stroke:var(--ink);stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
.stype b{font-family:var(--f-hz);font-size:18px} .stype small{display:block;font-size:11px;color:var(--muted);line-height:1.2}

/* palabra nueva */
.wcard{background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:22px 18px;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;box-shadow:var(--shadow)}
.wcard .w-hz{font-family:var(--f-hz);font-weight:700;font-size:clamp(64px,22vw,96px);line-height:1.1;word-break:keep-all}
.wcard .w-py{font-family:var(--f-display);font-weight:800;font-size:28px}
.wcard .w-m{font-size:19px;font-weight:700}
.wcard .w-tip{font-size:14px;color:var(--ink-2);background:var(--gold-soft);padding:10px 12px;border-radius:12px;max-width:36ch}
.new-tag{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--seal);background:var(--seal-soft);padding:4px 10px;border-radius:999px}

/* armar frase */
.build-target{font-size:18px;font-weight:700}
.answer-line{min-height:72px;border-bottom:2px solid var(--line);display:flex;flex-wrap:wrap;gap:8px;align-content:flex-start;padding-block:8px}
.answer-line.second{min-height:0;border-bottom:2px solid var(--line);height:0;padding:0}
.bank{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;padding-top:8px;min-height:60px}
.tok{font-family:var(--f-hz);font-size:22px;font-weight:700;padding:10px 14px;border-radius:14px;border:2px solid var(--line);border-bottom-width:4px;background:var(--surface);line-height:1.1;transition:transform .08s}
.tok:active{transform:translateY(2px)}
.tok.ghost{visibility:hidden}

/* escritura */
.w-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.w-head .py{font-family:var(--f-display);font-weight:800;font-size:28px}
.order-lbl{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.strip{display:flex;gap:6px;overflow-x:auto;padding-block:6px 4px;scrollbar-width:none}
.strip::-webkit-scrollbar{display:none}
.frame{flex:none;width:54px;display:flex;flex-direction:column;align-items:center;gap:2px}
.frame svg{width:54px;height:54px;border-radius:10px;background:var(--surface);border:1px solid var(--line);display:block}
.frame small{font-size:10px;font-weight:700;color:var(--muted)}
.frame .g{stroke:var(--line);stroke-width:12;stroke-dasharray:28 28}
.frame .done{fill:var(--ink)} .frame .cur{fill:var(--seal)} .frame .todo{fill:var(--surface-3)}
.frame .badge{fill:var(--seal)} .frame .badge-t{fill:#fff;font-family:var(--f-body);font-weight:800;font-size:115px}
.frame.on svg{outline:3px solid var(--seal);outline-offset:1px}
.writer-wrap{position:relative;width:min(310px,100%);aspect-ratio:1;margin:4px auto 0;border-radius:18px;background:var(--surface);border:1px solid var(--line);touch-action:none}
.writer-wrap svg.grid{position:absolute;inset:0;width:100%;height:100%}
.grid line{stroke:var(--line);stroke-width:1.2;stroke-dasharray:5 5}
.writer{position:relative}
.w-status{text-align:center;min-height:24px;font-weight:800;font-size:15px}
.w-status.ok{color:var(--ok)} .w-status.bad{color:var(--bad)}
.switch{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;color:var(--muted);font-weight:600}
.switch input{width:20px;height:20px;accent-color:var(--jade)}

/* hablar */
.mic{width:96px;height:96px;border-radius:50%;background:var(--seal);color:#fff;display:grid;place-items:center;box-shadow:0 6px 0 color-mix(in srgb,var(--seal) 60%,#000);position:relative;transition:transform .08s,box-shadow .08s}
.mic:active{transform:translateY(4px);box-shadow:0 2px 0 color-mix(in srgb,var(--seal) 60%,#000)}
.mic svg{width:40px;height:40px}
.mic.rec{animation:recpulse 1s ease-in-out infinite}
@keyframes recpulse{50%{box-shadow:0 6px 0 color-mix(in srgb,var(--seal) 60%,#000),0 0 0 14px color-mix(in srgb,var(--seal) 25%,transparent)}}
.target{text-align:center;display:flex;flex-direction:column;gap:6px;align-items:center}
.target .t-hz{font-family:var(--f-hz);font-weight:700;font-size:clamp(34px,11vw,52px);line-height:1.2}
.target .t-py{font-family:var(--f-display);font-weight:700;font-size:19px}
.heard{display:flex;justify-content:center;flex-wrap:wrap;gap:2px;font-family:var(--f-hz);font-size:32px;font-weight:700;min-height:44px}
.heard .y{color:var(--ok)} .heard .n{color:var(--bad);text-decoration:underline wavy;text-underline-offset:6px}
.hint-box{font-size:14px;color:var(--ink-2);background:var(--surface-2);padding:12px 14px;border-radius:14px}
.lab-chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.lab-chips::-webkit-scrollbar{display:none}
.lab-chips button{flex:none;padding:8px 14px;border-radius:12px;background:var(--surface);border:2px solid var(--line);font-family:var(--f-hz);font-weight:700;font-size:18px}
.lab-chips button[aria-pressed="true"]{border-color:var(--ink)}
.pitch{width:100%;height:auto;display:block;background:var(--surface);border:1px solid var(--line);border-radius:16px}
.pitch .gl{stroke:var(--line);stroke-width:1}
.pitch .nat{fill:none;stroke:var(--muted);stroke-width:6;stroke-linecap:round;stroke-linejoin:round;opacity:.55}
.pitch .you{fill:none;stroke:var(--seal);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.pitch text{fill:var(--muted);font-size:10px;font-family:var(--f-body);font-weight:700}
.legend{display:flex;gap:14px;justify-content:center;font-size:13px;color:var(--muted);font-weight:700}
.legend i{display:inline-block;width:18px;height:5px;border-radius:3px;vertical-align:middle;margin-right:5px}

/* repaso */
.flash{background:var(--surface);border:1px solid var(--line);border-radius:24px;min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:20px;box-shadow:var(--shadow)}
.flash .front{font-family:var(--f-hz);font-weight:700;font-size:clamp(64px,22vw,92px);line-height:1.1}
.flash.flip .front{animation:flipin .4s ease}
@keyframes flipin{from{transform:rotateX(70deg);opacity:.3}to{transform:none;opacity:1}}
.rates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.rate{padding:10px 2px;border-radius:14px;background:var(--surface);border:2px solid var(--line);border-bottom-width:4px;font-weight:800;font-size:14px;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:58px;justify-content:center}
.rate small{font-weight:600;font-size:11px;color:var(--muted)}
.rate.r0{border-color:var(--bad)} .rate.r1{border-color:var(--t2)} .rate.r2{border-color:var(--ok)} .rate.r3{border-color:var(--t4)}

/* resultado */
.result{text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px;padding-block:20px}
.result .big{font-family:var(--f-display);font-weight:800;font-size:64px;line-height:1;font-variant-numeric:tabular-nums}
.result .brush{font-size:64px;color:var(--seal);line-height:1}
.result-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;margin-top:8px}
.result-stats div{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px 4px;font-size:12px;color:var(--muted);font-weight:700}
.result-stats b{display:block;font-family:var(--f-display);font-size:24px;color:var(--ink)}

/* overlay */
.overlay{position:fixed;inset:0;z-index:60;background:color-mix(in srgb,#000 45%,transparent);display:grid;place-items:center;padding:16px}
.modal{background:var(--surface);border-radius:26px;padding:26px 20px 20px;max-width:380px;width:100%;text-align:center;animation:rise .45s cubic-bezier(.2,.9,.3,1.3) both;display:flex;flex-direction:column;gap:10px;align-items:center}
@keyframes rise{from{transform:translateY(30px) scale(.92);opacity:0}}
.modal .big-stamp{width:96px;height:96px;font-size:68px;border-radius:16px}
.modal h3{font-size:24px}
#confetti{position:fixed;inset:0;pointer-events:none;z-index:70;width:100%;height:100%}
.float{position:fixed;z-index:80;font-weight:800;color:var(--seal);pointer-events:none;animation:floatup .9s ease forwards;font-family:var(--f-display);font-size:15px}
@keyframes floatup{to{transform:translateY(-36px);opacity:0}}
.toast{position:fixed;left:16px;right:16px;margin-inline:auto;width:fit-content;bottom:calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:12px 16px;border-radius:14px;font-size:14px;font-weight:700;z-index:90;animation:enter .25s ease both;max-width:440px;text-align:center}
body.in-player .toast{bottom:calc(110px + env(safe-area-inset-bottom,0px))}

@media (min-width:700px){
  body{background-image:radial-gradient(circle at 20% 0%,color-mix(in srgb,var(--seal) 7%,transparent),transparent 40%)}
  .greet h1{font-size:38px}
}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* ---------- Miāo, la mascota ---------- */
:root{--cat:#F2A14A;--cat-dark:#D27A2C;--cat-light:#FFF2E0;--cat-ear:#F6B3A6;--cat-nose:#E16C78;--cat-blush:rgba(232,104,120,.35);--cat-ink:#2A2421}
.cat{display:block;width:100%;height:auto;overflow:visible}
.cat .pupil{fill:var(--cat-ink)} .cat .glint{fill:#fff}
.cat .line{fill:none;stroke:var(--cat-ink);stroke-width:3.4;stroke-linecap:round;stroke-linejoin:round}
.cat .mouth-fill{fill:#B7414D;stroke:var(--cat-ink);stroke-width:2.4;stroke-linejoin:round}
.cat .whisker{stroke:var(--cat-ink);stroke-width:1.6;stroke-linecap:round;opacity:.55}
.cat .band-hz{fill:#fff;font-family:var(--f-brush);font-size:10px}
.cat .zz{fill:var(--muted);font-family:var(--f-display);font-weight:800;font-size:14px;animation:zz 2.4s ease-in-out infinite}
.cat .zz.small{font-size:10px;animation-delay:.6s}
@keyframes zz{0%,100%{opacity:.2;transform:translateY(2px)}50%{opacity:1;transform:translateY(-3px)}}
.cat .cat-tail{transform-origin:86px 104px;animation:tail 2.6s ease-in-out infinite}
@keyframes tail{0%,100%{transform:rotate(0)}50%{transform:rotate(-12deg)}}
.cat .cat-ribbon{transform-origin:99px 48px;animation:ribbon 1.6s ease-in-out infinite}
@keyframes ribbon{0%,100%{transform:rotate(0)}50%{transform:rotate(9deg) skewY(-4deg)}}
.cat .cat-blink{transform-origin:60px 60px;transform-box:view-box;animation:blink 4.5s infinite}
@keyframes blink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.1)}}
.cat.bounce{animation:catbounce .9s cubic-bezier(.3,1.6,.5,1) both}
@keyframes catbounce{0%{transform:translateY(16px) scale(.85);opacity:0}60%{transform:translateY(-6px) scale(1.04);opacity:1}100%{transform:none}}
.mascot{display:flex;align-items:center;gap:10px}
.cat-btn{width:96px;flex:none;border-radius:20px;padding:2px}
.cat-btn:active .cat{transform:scale(.95)}
.cat-btn.jump .cat{animation:catjump .55s cubic-bezier(.3,1.7,.5,1)}
@keyframes catjump{30%{transform:translateY(-14px) rotate(-6deg)}70%{transform:translateY(0) rotate(3deg)}}
.bubble{position:relative;flex:1;min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:10px 14px;box-shadow:var(--shadow);font-size:15px}
.bubble::before{content:"";position:absolute;left:-8px;top:50%;width:14px;height:14px;background:var(--surface);border-left:1px solid var(--line);border-bottom:1px solid var(--line);transform:translateY(-50%) rotate(45deg)}
.bubble b{font-family:var(--f-display);font-size:14px;color:var(--seal)} .bubble .hz{font-weight:700}
.bubble p{line-height:1.35}
.s-cat{width:44px;flex:none;margin:-6px 0 -4px}
.s-quip{font-size:14px;color:var(--ink-2);margin-top:-6px}
.res-cat{width:120px;margin-bottom:4px}
.cat-mini{width:64px;flex:none}
.err-card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:12px 16px}
.err-card:active{transform:scale(.99)}
.err-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.err-txt b{font-family:var(--f-display);font-size:18px}
.pips{display:flex;gap:4px;margin-top:5px}
.pips i{width:22px;height:5px;border-radius:3px;background:var(--surface-3)}
.pips i.on{background:var(--jade)}
.tbars{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.tb{display:grid;grid-template-columns:36px 1fr 44px;align-items:center;gap:10px;font-weight:800}
.tb .bar{margin-top:0;height:10px;border-radius:9px;background:var(--surface-2);overflow:hidden}
.tb span:last-child{text-align:right;color:var(--muted)}
.ink{color:var(--ink)}
.modal.ob{max-height:calc(100vh - 32px);overflow-y:auto;gap:12px;padding-top:20px}
.ob-cat{width:150px} .ob-cat.small{width:96px}
.modal .scen{text-align:left}
.mins{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;width:100%}
.mins button{padding:14px 4px;border-radius:16px;background:var(--surface-2);display:flex;flex-direction:column;align-items:center;border:2px solid transparent}
.mins b{font-family:var(--f-display);font-size:26px;line-height:1} .mins span{font-size:12px;color:var(--muted);font-weight:700}
.mins button[aria-pressed="true"]{border-color:var(--ink);background:var(--surface)}

.heard .live{color:var(--muted)}
.idk{display:block;margin:4px auto 0;color:var(--muted);font-weight:700}
.wcard .w-py[hidden]{display:none}
.rates.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.recap{display:flex;flex-direction:column;gap:8px}
.rc{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:10px 14px;border-radius:16px;background:var(--surface);border:1px solid var(--line)}
.rc .hz{font-size:26px;font-weight:700;min-width:64px}
.rc-t{flex:1;min-width:0;display:flex;flex-direction:column}
.rc-t b{font-family:var(--f-display);font-size:17px} .rc-t span{font-size:13px;color:var(--muted)}
.rc svg{width:22px;height:22px;color:var(--t4);flex:none}
.rc.heard-ok{border-color:var(--jade)}

/* Escalera del oído y comparar tonos */
.ladder{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;padding:10px 12px;border-radius:14px;background:var(--surface-2);font-size:13px;margin-bottom:4px}
.ladder span{color:var(--muted);font-weight:700}
.ladder b{font-weight:800}
.ladder i{display:flex;gap:4px;margin-left:auto}
.ladder em{width:8px;height:8px;border-radius:50%;background:var(--line)}
.ladder em.ok{background:var(--t3)}.ladder em.no{background:var(--t1)}
.cmp-l{text-align:center;margin:6px 0 -2px}
.cmp{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px}
.chip-say{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 12px;border-radius:999px;border:1.5px solid var(--line);background:var(--surface);font-weight:800;font-size:14px}
.chip-say svg{width:16px;height:16px;color:var(--muted)}
.chip-say.playing{border-color:var(--t4)}
.s-why .cmp{justify-content:flex-start}
.skills .tb{grid-template-columns:128px 1fr 44px;font-size:14px}
