/* Vietnamese Lab additions (draft). Base look = Mandarin Character Lab s33 app.css, copied unchanged as base.css */
.site-head .wrap{gap:10px}
.vi,[lang=vi]{font-family:'DMSans',system-ui,sans-serif}
h2{font-family:'Brico','DMSans',sans-serif;color:var(--ink);font-size:1.4rem;margin:.6em 0 .4em}
.center{text-align:center}
section[role=tabpanel]{margin-bottom:1.5em}
.abcgrid{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.abcgrid button{width:100%;min-height:96px;border:2px solid var(--rule);border-radius:14px;background:#fff;color:var(--ink);cursor:pointer;padding:6px;display:flex;flex-direction:column;align-items:center;gap:2px;font:inherit}
.abcgrid .big{font:800 2rem/1 'Brico','DMSans',sans-serif;color:var(--plum)}
.abcgrid .special{border-color:var(--plum);background:#F7EEF7}
.abcgrid .ex{font-weight:600}.abcgrid .en{font-size:.78rem;color:var(--muted);text-align:center;line-height:1.2}
.tonelist{display:grid;gap:10px}
.tone{background:#fff;border:1px solid var(--rule);border-radius:16px;padding:12px 14px}
.tone .th{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.tone .tw{font:800 2rem/1 'Brico','DMSans',sans-serif;color:var(--plum)}
.tone .tn{font-weight:700;color:var(--ink)}.tone .tm{color:var(--muted);font-size:.9rem}
.tone p{margin:.3em 0}.tone .row{justify-content:flex-start;margin-top:6px}
.tone.merge{border-left:5px solid var(--yellow)}
.wordlist{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.wordlist li{background:#fff;border:1px solid var(--rule);border-radius:14px;padding:10px 12px;display:grid;grid-template-columns:1fr auto;gap:2px 10px;align-items:center}
.wv{font-weight:700;font-size:1.2rem;color:var(--ink)}.we{color:var(--slate)}.wn{grid-column:1/-1;font-size:.86rem;color:var(--muted)}
.say{min-width:48px;min-height:48px;border-radius:999px;border:2px solid var(--plum);background:#fff;color:var(--plum);font-size:1.1rem;cursor:pointer}
.trap{display:inline-block;font:500 .72rem 'DMMono',monospace;background:#FFF4D6;color:var(--ink);border-radius:999px;padding:2px 8px;margin:2px 4px 0 0}
.fccard{width:100%;min-height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font:inherit;cursor:pointer;text-align:center}
.fccard .fv{font:800 2.2rem/1.15 'Brico','DMSans',sans-serif;color:var(--ink)}
.vin{width:100%;min-height:52px;font:600 1.3rem 'DMSans',sans-serif;padding:8px 12px;border:2px solid var(--rule);border-radius:12px;color:var(--ink);background:#fff}
.vin:focus{border-color:var(--sapphire)}
.helper{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.helper button{min-width:44px;min-height:44px;border:2px solid var(--rule);border-radius:10px;background:#fff;color:var(--ink);font:600 1.15rem 'DMSans',sans-serif;cursor:pointer;padding:0 8px}
.helper .tb{border-color:var(--plum);color:var(--plum)}
.helper .lbl{flex:0 0 100%;font-size:.8rem;color:var(--muted)}
.tiles{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:10px 0}
.tiles button{min-width:48px;min-height:52px;border:2px solid var(--plum);border-radius:12px;background:#fff;color:var(--ink);font:700 1.4rem 'DMSans',sans-serif;cursor:pointer}
.tiles button:disabled{opacity:.3}
.tiles.marks button{font-size:1rem;min-width:64px;padding:0 6px}
.tiles.marks button[aria-pressed=true]{background:var(--plum);color:#fff}
.build{min-height:64px;border:2px dashed var(--rule);border-radius:14px;display:flex;align-items:center;justify-content:center;font:800 2rem 'Brico','DMSans',sans-serif;color:var(--ink);margin:6px 0;letter-spacing:.04em}
.opts{display:grid;gap:8px;margin:10px 0}
.opts button{min-height:52px;border:2px solid var(--plum);border-radius:14px;background:#fff;color:var(--ink);font:600 1.15rem 'DMSans',sans-serif;cursor:pointer;text-align:left;padding:8px 14px}
.opts button.right{background:#E3F4EA;border-color:var(--green)}.opts button.wrong{background:#FBE7E4;border-color:#B5452F}
.opts .om{display:block;font-weight:400;font-size:.88rem;color:var(--muted)}
.fb{min-height:1.5em;font-weight:600;text-align:center;margin:6px 0}.fb.pass{color:var(--green)}.fb.fail{color:#8A3324}
.hint{font-size:.9rem;background:#F4EFE4;border-radius:10px;padding:8px 10px;margin:6px 0}
.qprompt{font-size:1.15rem;font-weight:600;color:var(--ink);margin:.3em 0}
.qbig{font:800 2rem/1.2 'Brico','DMSans',sans-serif;color:var(--ink);text-align:center;margin:.2em 0}
.mmboard{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.mmboard button{min-height:72px;border:2px solid var(--rule);border-radius:12px;background:#fff;color:var(--ink);font:600 1rem 'DMSans',sans-serif;cursor:pointer;padding:6px}
.mmboard button.vi{font-size:1.15rem}
.mmboard button[aria-pressed=true]{border-color:var(--plum);background:#F7EEF7}
.mmboard button.done{background:#E3F4EA;border-color:var(--green);color:var(--green)}
.ktab{border-collapse:collapse;width:100%;margin:8px 0;background:#fff}.ktab th,.ktab td{border:1px solid var(--rule);padding:6px 8px;text-align:left}.ktab td:first-child{font-weight:700;font-size:1.1rem}
.foot{margin:2em 0}
.ttbtns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.ttbtns button{min-height:60px;border:2px solid var(--plum);border-radius:14px;background:#fff;color:var(--ink);font:600 1rem 'DMSans',sans-serif;cursor:pointer}
.ttbtns button .m{display:block;font-size:1.4rem;color:var(--plum)}
.ttbtns button.right{background:#E3F4EA;border-color:var(--green)}.ttbtns button.wrong{background:#FBE7E4;border-color:#B5452F}
.ttbtns.six{grid-template-columns:1fr 1fr}
.accbar .srcb{font-size:1rem}
.wn strong{color:var(--ink);font-weight:600}
/* ---- v2: level/topic menu, Make a Sentence, Patterns, Stories, celebrations ---- */
.setnav{margin:6px 0 10px}
.lvlgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:6px 0}
.lvlb{min-height:52px;border:2px solid var(--plum);border-radius:12px;background:#fff;color:var(--ink);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;font:inherit;padding:4px}
.lvlb .lvbac{font-weight:700}.lvlb .lvcefr{font-size:.78rem;color:var(--muted)}
.lvlb.later{border-color:var(--rule)}
.lvlb[aria-pressed=true]{background:var(--plum);color:#fff;border-color:var(--plum)}.lvlb[aria-pressed=true] .lvcefr{color:#fff}
.lvlcard,.topic{background:#fff;border:1px solid var(--rule);border-radius:14px;padding:10px 12px;margin:6px 0}
.lvlcard p,.topic p{margin:.3em 0}.lvlh{font-size:1rem}
.soon{font-weight:600;color:var(--ink);background:#FFF4D6;border-radius:10px;padding:6px 10px}
.topics{display:grid;gap:6px}.toph{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.lvltag{font:500 .72rem 'DMMono',monospace;background:#EEF1F8;color:var(--ink);border-radius:999px;padding:2px 8px;margin-left:auto}
.soonlist{list-style:none;margin:0;padding:0;display:grid;gap:4px}.soonlist li{display:flex;align-items:center;color:var(--slate)}
.topic.later{background:#FAF8F3}
.pick.wide{margin:6px 0}.pick.wide select{flex:1 1 auto;min-width:0}
#p-ms .wt{font:700 1.25rem/1.1 'DMSans',sans-serif;min-height:52px;padding:6px 12px}
.svi.msbig{font:800 1.6rem/1.25 'Brico','DMSans',sans-serif;color:var(--ink);margin:.2em 0}
.ptpick .srcb{font-size:.92rem}
.ptframe{font:800 1.5rem/1.3 'Brico','DMSans',sans-serif;color:var(--plum);background:#F7EEF7;border-radius:12px;padding:8px 12px;margin:8px 0}
#pt-card h3,.sttitle{font-family:'Brico','DMSans',sans-serif;color:var(--ink);margin:.8em 0 .3em}
.qbig.sm{font-size:1.5rem}
.stlist{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.stbtn{width:100%;text-align:left;border:2px solid var(--rule);border-radius:14px;background:#fff;padding:10px 12px;cursor:pointer;font:inherit;display:flex;flex-direction:column;gap:2px;color:var(--ink)}
.stt{font-weight:700;font-size:1.15rem}.ste{font-size:.88rem;color:var(--muted)}
.row.left{justify-content:flex-start}.stctl{justify-content:flex-start;flex-wrap:wrap;gap:8px}
.stlines{list-style:none;padding:0;margin:10px 0;display:grid;gap:6px}
.stline{width:100%;text-align:left;border:2px solid transparent;border-radius:12px;background:#fff;padding:8px 12px;cursor:pointer;font:inherit;color:var(--ink);display:flex;flex-direction:column;gap:2px}
.stline .sp{font-size:.8rem;font-weight:700;color:var(--plum)}
.stline .svi{font-size:1.25rem;font-weight:600;line-height:1.35}
.stline .sen{display:none;font-size:.95rem;color:var(--slate)}
.showen .stline .sen{display:block}
.stlines li.now .stline{border-color:var(--plum);background:#F7EEF7}
#st-en[aria-pressed=true]{background:var(--plum);color:#fff}
/* celebrations */
.vcele{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:rgba(255,253,248,.94);cursor:pointer;overflow:hidden;padding:16px}
.vcele[hidden]{display:none}
.vcele .cart svg{display:block;max-width:80vw;height:auto}
.vcele .ccard{background:#fff;border:2px solid var(--plum);border-radius:16px;padding:10px 18px;text-align:center;max-width:320px}
.vcele .cvi{font:800 1.7rem/1.2 'Brico','DMSans',sans-serif;color:var(--plum);margin:0}.vcele .cen{margin:.2em 0;color:var(--ink)}
.vcele.moto .cart{animation:vc-ride 3.2s ease-in-out both}
.vcele.moto .bike{transform-origin:52px 140px;animation:vc-wheelie 3.2s ease-in-out both}
@keyframes vc-ride{0%{transform:translateX(-75vw)}100%{transform:translateX(75vw)}}
@keyframes vc-wheelie{0%,12%{transform:rotate(0)}30%,75%{transform:rotate(-20deg)}90%,100%{transform:rotate(0)}}
.vcele.bun .cart{animation:vc-rise .8s ease-out both}.vcele.bun .steam{animation:vc-steam 1.4s ease-in-out infinite}
@keyframes vc-rise{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
@keyframes vc-steam{0%,100%{transform:translateY(0);opacity:.9}50%{transform:translateY(-6px);opacity:.4}}
.vcele.banhmi .dance{transform-origin:100px 150px;animation:vc-dance .9s ease-in-out infinite}
.vcele.banhmi .arms{animation:vc-arms .45s ease-in-out infinite alternate}
@keyframes vc-dance{0%,100%{transform:rotate(-8deg) translateY(0)}50%{transform:rotate(8deg) translateY(-10px)}}
@keyframes vc-arms{from{transform:translateY(0)}to{transform:translateY(-8px)}}
.vcele.nonla .head{transform-origin:100px 100px;animation:vc-lookup 1.2s ease-out both}
.vcele.nonla .thumb{transform-origin:140px 140px;animation:vc-thumb 1.2s .5s ease-out both}
@keyframes vc-lookup{from{transform:rotate(0) translateY(6px)}to{transform:none}}
@keyframes vc-thumb{from{transform:rotate(40deg) translateY(30px);opacity:0}to{transform:none;opacity:1}}
.vcele.aodai .clapL{transform-origin:80px 104px;animation:vc-clapL .35s ease-in-out infinite alternate}
.vcele.aodai .clapR{transform-origin:120px 104px;animation:vc-clapR .35s ease-in-out infinite alternate}
.vcele.aodai .sparks{animation:vc-steam .7s ease-in-out infinite}
@keyframes vc-clapL{from{transform:rotate(14deg)}to{transform:none}}
@keyframes vc-clapR{from{transform:rotate(-14deg)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.vcele *,.vcele .cart{animation:none!important}}
.setnav .setb{flex:1 1 auto;min-width:auto;white-space:nowrap}
.ptpick{display:grid;grid-template-columns:1fr 1fr;gap:6px}.ptpick .srcb{min-width:0;font-size:.9rem;line-height:1.25}
.stctl{flex-wrap:wrap}.stctl>*{flex:1 1 auto;white-space:nowrap;min-width:auto}
.sttitle{font-size:1.5rem}

/* v4 DRAFT: Build a Sentence. Colour is never the only cue: every block also shows a code and word-type label. */
[data-pos=pron]{--c:#6B4FA0}[data-pos=noun]{--c:#1F6FB2}[data-pos=verb]{--c:#B23A2E}[data-pos=adj]{--c:#2E7D32}[data-pos=num]{--c:#8A6A00}
[data-pos=cls]{--c:#00796B}[data-pos=q]{--c:#AD1457}[data-pos=time]{--c:#6D4C41}[data-pos=part]{--c:#546E7A}[data-pos=none]{--c:var(--rule)}
.bsframe{font-size:1.15rem}
.bsslots{list-style:none;margin:10px 0 4px;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.bsslots li{flex:1 1 84px;min-width:0;max-width:200px}
.bslot{width:100%;min-height:62px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;padding:6px 8px;border:2px dashed var(--rule);border-radius:12px;background:#fff;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.bslot.full{border-style:solid;border-left:7px solid var(--c)}
.bslot.opt:not(.full){background:#FAFAF7}
.bslot.bad{border-color:#B23A2E;border-style:solid;background:#FDECEA}
.bslot .bsl{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}
.bslot .bsw{font-weight:700;overflow-wrap:anywhere}
.bslot:not(.full) .bsw{font-weight:400;font-size:.8rem;color:var(--muted)}
.bsgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:12px 0 6px}
@media (min-width:720px){.bsgrid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}}
.bsb{position:relative;display:flex;flex-direction:column;border:2px solid var(--rule);border-left:7px solid var(--c);border-radius:12px;background:#fff;min-width:0}
.bsb.sel{outline:3px solid var(--plum);outline-offset:1px;background:#F7EEF7}
.bsb.used{opacity:.45}
.bspick{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:60px;padding:6px 6px 4px;border:0;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer;min-width:0}
.bspick:disabled{cursor:default}
.bsv{font-weight:700;font-size:1rem;line-height:1.2;overflow-wrap:anywhere}
.bsp{font-size:.66rem;line-height:1.2;color:var(--c);font-weight:700;overflow-wrap:anywhere}
.bsay{align-self:flex-end;margin:0 3px 3px 0;width:40px;height:34px;border:1px solid var(--rule);border-radius:10px;background:#fff;font-size:1rem;cursor:pointer}
.bslegend{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.bslg{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border:1px solid var(--rule);border-left:6px solid var(--c);border-radius:8px;font-size:.8rem;background:#fff}
.bslg b{color:var(--c)}
.bsnotes{margin:10px 0}.bsnotes summary{cursor:pointer;font-weight:700}
.msg.ok{color:#2E7D32;font-weight:700}.msg.bad{color:#B23A2E}

/* v4 DRAFT: third settings button (Effects) - let the settings row wrap on phones */
.setbar{flex-wrap:wrap;row-gap:6px}
/* v4 DRAFT: grammar-pattern ladder (Mandarin-style list + builder) */
.ptlv .ptn{display:inline-block;min-width:1.6em;padding:0 .35em;margin-left:.15em;border-radius:999px;background:#F3E8F4;color:var(--plum);font-size:.8rem;font-weight:700}
.ptlv button[aria-pressed=true] .ptn{background:#fff}
.ptprev{display:inline-block;font-size:.75rem;font-weight:700;color:#7A4E00;background:#FFF3CF;border:1px solid #E8C66A;border-radius:999px;padding:0 .5em;vertical-align:middle}
.pt-ex{font-family:inherit!important}
.ptsent{font:600 1.45rem/2.3 'DMSans',sans-serif;overflow-wrap:anywhere}
.ptslot.ty-S{border-color:#6B4FA0;background:#EEE8F7}.ptslot.ty-N{border-color:#1F6FB2;background:#E6EEF7}.ptslot.ty-V{border-color:var(--green);background:#E3F1EA}
.ptslot.ty-A{border-color:#2E7D32;background:#EAF4E4}.ptslot.ty-T{border-color:#6D4C41;background:#F3ECE8}.ptslot.ty-C{border-color:#B07A00;background:#FFF3CF}
.ptlit{margin:0 2px}.ptp{margin:0 2px 0 0}
#pt-prac{margin-top:8px}
#bs-patl .srcb{min-height:40px}
/* v4 DRAFT: Words grid + word card (Mandarin-style lightbox) */
.wgrid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}
.wcell{min-height:60px;padding:6px 4px}.wcell b{font-size:1.1rem;font-weight:600;line-height:1.2;text-align:center;overflow-wrap:anywhere}
.gbox .lbx{position:absolute;top:8px;right:8px;width:44px;height:44px}
.wbc{font-size:clamp(1.8rem,9vw,3rem);font-weight:700;color:var(--ink);padding:0 40px;overflow-wrap:anywhere}
.wbforms{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:6px 0}
.wbf{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--rule);border-radius:999px;padding:2px 2px 2px 12px;background:#fff}.wbf.on{border-color:var(--plum);background:#F7EEF7}
.wbf .say{min-width:44px;min-height:44px}.wbr{font-size:.85rem;color:var(--muted)}
.wbposl{margin:4px 0}.wbpos{display:inline-block;border:2px solid var(--c,var(--rule));color:var(--c,var(--ink));border-radius:8px;padding:0 8px;margin:2px;font-size:.85rem;background:#fff}
.wbex li{padding:8px 0}.wbsrow{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}.wbs{margin:0;font-size:1.15rem;overflow-wrap:anywhere}
.wbs mark{background:#ffe08a;color:inherit;padding:0 2px;border-radius:3px}.wbse{margin:2px 0 0;font-style:italic}
.wbpl{display:flex;flex-wrap:wrap;gap:6px}.wbpl .srcb{min-height:40px}
[data-pos=phrase]{--c:#5E5672}[data-pos=loc]{--c:#00838F}
/* ---- v5 DRAFT: scored flash cards ---- */
.fcrev{border-top:1px solid var(--rule);margin-top:10px;padding-top:8px}
.fcans{display:grid;grid-template-columns:1fr auto;gap:2px 10px;align-items:center;background:#fff;border:1px solid var(--rule);border-radius:14px;padding:10px 12px;margin:6px 0}
.fcans .we{grid-column:1/-1}
.fcagain{display:inline-block;background:#FFF4D6;border-radius:999px;padding:2px 10px;margin:0 0 4px;font-weight:600;color:var(--ink)}
.fcback{color:var(--slate)}
.fcview{margin:12px 0 0}
#fcs-card .vin:disabled{background:#F4EFE4;color:var(--ink)}
/* ---- v5 DRAFT: dialogues (A left, B right) ---- */
.dlg{list-style:none;padding:0;margin:10px 0;display:grid;gap:10px}
.dlg li{display:flex;align-items:flex-end;gap:8px}
.dlg li.dlb{flex-direction:row-reverse}
.dface{flex:0 0 40px;width:40px;height:40px;line-height:0}
.bub{max-width:min(78%,520px);text-align:left;border:2px solid var(--rule);border-radius:16px;background:#fff;padding:8px 12px;cursor:pointer;font:inherit;color:var(--ink);display:flex;flex-direction:column;gap:2px}
.dla .bub{border-bottom-left-radius:4px}
.dlb .bub{border-bottom-right-radius:4px;background:#F4F7FB}
.bub .dname{font-size:.8rem;font-weight:700;color:var(--plum)}
.bub .dvi{font-size:1.2rem;font-weight:600;line-height:1.35}
.bub .den{font-size:.95rem;color:var(--slate)}
.hideen .bub .den{display:none}
.dlg li.now .bub{border-color:var(--plum);background:#F7EEF7}

/* v6 DRAFT: Bậc 3–4 — All-words chip, in-play line, Words order toggle */
.allb{font-weight:700}
.lvlead{margin:.5rem 0 .25rem}
.inplay{margin-top:.5rem;font-weight:600}
#w-sort{margin:.25rem 0 .75rem}

/* 2026-11-22 level split: Members only state (shown only when a level's data file is not served) */
.lvlock{border:1px solid var(--rule);border-radius:10px;padding:6px 10px;margin:6px 0;background:#F6F6F4}.lvlock p{margin:.25em 0}.lockb[disabled]{opacity:.6;cursor:not-allowed}
/* Accessibility (2026-11-26): letter cards keep their dark tile but use a light tint (11.4:1 on #2B2540);
   the Sound/Slow buttons' "off" state is dimmed less so its label stays readable (5.1:1 on #FAF5EF). */
.abcgrid .big{color:#F3DDF4}
.sndbtn[aria-pressed=false]{opacity:.8}
