:root{
  --bg:#f6f5fb; --card:#fff; --ink:#1d1b2e; --muted:#6b6880; --line:#d9d6e8;
  --accent:#4f46e5; --accent-ink:#fff; --good:#16a34a; --good-bg:#dcfce7;
  --bad:#dc2626; --bad-bg:#fee2e2; --shadow:0 2px 10px rgba(40,30,90,.08);
  --ipa:"Charis SIL","Gentium Plus","Gentium","Doulos SIL","Noto Sans","Segoe UI",system-ui,-apple-system,"Lucida Sans Unicode",serif;
}
@media (prefers-color-scheme:dark){:root{
  --bg:#13121c; --card:#1e1c2c; --ink:#ecebf6; --muted:#a09db6; --line:#38354f;
  --accent:#8b83ff; --accent-ink:#13121c; --good:#4ade80; --good-bg:#12361f;
  --bad:#f87171; --bad-bg:#431818; --shadow:0 2px 10px rgba(0,0,0,.4);
}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:17px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);min-height:100vh}
[hidden]{display:none!important}
button,select{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
kbd{font:600 .75em ui-monospace,Menlo,monospace;border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;padding:1px 6px;background:var(--bg);color:var(--muted)}
.top{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;max-width:760px;margin:0 auto;padding:14px 16px 6px}
.brand{font-size:1.1rem;margin:0;font-weight:700}
.brand span{color:var(--accent);font-family:var(--ipa);font-size:1.4em}
.tabs{display:flex;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:3px}
.tabs button{border:0;background:none;padding:9px 16px;border-radius:9px;min-height:44px;font-weight:600;color:var(--muted)}
.tabs button[aria-selected=true]{background:var(--accent);color:var(--accent-ink)}
main{max-width:760px;margin:0 auto;padding:8px 16px 40px}
.panel{display:flex;flex-direction:column;align-items:center;gap:14px}
.scorebar{display:flex;gap:10px;width:100%}
.scorebar>div{flex:1;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:8px;text-align:center;font-size:1.3rem;box-shadow:var(--shadow)}
.scorebar small{display:block;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.06em}
.replay{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:min(100%,360px);min-height:120px;
  border:2px solid var(--accent);background:var(--card);color:var(--accent);border-radius:24px;font-weight:700;font-size:1.1rem;box-shadow:var(--shadow);margin-top:6px}
.replay:active,.replay.playing{background:var(--accent);color:var(--accent-ink)}
.prompt{margin:0;color:var(--muted)}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%}
.choice{position:relative;min-height:112px;border:2px solid var(--line);background:var(--card);border-radius:20px;
  font-family:var(--ipa);font-size:3.4rem;line-height:1;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center}
.choice .k{position:absolute;top:8px;left:12px;font:600 .8rem system-ui,sans-serif;color:var(--muted)}
.choice:hover:not(:disabled){border-color:var(--accent)}
.choice:disabled{cursor:default;opacity:.55}
.choice.correct{opacity:1;background:var(--good-bg);border-color:var(--good);color:var(--good)}
.choice.wrong{opacity:1;background:var(--bad-bg);border-color:var(--bad);color:var(--bad)}
.feedback{min-height:84px;width:100%;text-align:center;display:flex;flex-direction:column;justify-content:center;gap:2px}
.feedback .verdict{font-weight:700;font-size:1.25rem}
.feedback.good .verdict{color:var(--good)} .feedback.bad .verdict{color:var(--bad)}
.feedback .vname{font-size:1.15rem}
.feedback .vsym{font-family:var(--ipa);font-size:1.5em}
.feedback .other{color:var(--muted);font-size:.95rem}
.primary{background:var(--accent);color:var(--accent-ink);border:0;border-radius:16px;padding:14px 28px;min-height:56px;font-weight:700;font-size:1.15rem}
.primary kbd{background:transparent;color:inherit;border-color:currentColor;opacity:.7}
.primary.big{font-size:1.4rem;padding:18px 40px}
.primary:disabled{opacity:.6}
.next{width:min(100%,360px)}
.settings{width:100%;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:4px 14px;margin-top:8px}
.settings summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600;color:var(--muted)}
.settings label{display:flex;flex-direction:column;gap:6px;margin:8px 0}
select{padding:12px;border-radius:10px;border:1px solid var(--line);background:var(--bg);min-height:48px}
.row{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
.ghost{border:1px solid var(--line);background:none;border-radius:10px;padding:10px 14px;min-height:44px}
.danger{color:var(--bad)}
.hint{color:var(--muted);font-size:.9rem}.center{text-align:center;margin:0}
.chart-info{display:flex;align-items:center;gap:14px;justify-content:center;min-height:64px;background:var(--card);border:1px solid var(--line);border-radius:16px;width:100%;padding:8px 16px}
.chart-info .sym{font-family:var(--ipa);font-size:2.6rem;line-height:1;color:var(--accent)}
.chart-info .nm{font-size:1.2rem;font-weight:600}
#vchart{width:100%;height:auto;max-width:640px;user-select:none;-webkit-user-select:none}
.cht .grid{stroke:var(--line);stroke-width:1.5;fill:none}
.cht .dash{stroke-dasharray:4 5}
.cht .lbl{fill:var(--muted);font:600 12px system-ui,sans-serif}
.cht .v{cursor:pointer;outline:none}
.cht .v .hit{fill:var(--card);stroke:var(--line);stroke-width:3}
.cht .v text{font-family:var(--ipa);font-size:23px;fill:var(--ink);text-anchor:middle;dominant-baseline:central;pointer-events:none}
.cht .v:hover .hit{stroke:var(--accent)}
.cht .v.sel .hit,.cht .v:focus-visible .hit{fill:var(--accent);stroke:var(--accent)}
.cht .v.sel text,.cht .v:focus-visible text{fill:var(--accent-ink)}
.start{position:fixed;inset:0;z-index:10;background:var(--bg);display:flex;align-items:center;justify-content:center;padding:20px}
.start{overflow-y:auto;align-items:flex-start}
.start-card{margin:auto;width:100%;background:var(--card);border:1px solid var(--line);border-radius:28px;padding:26px 20px;max-width:520px;text-align:center;box-shadow:var(--shadow)}
.start-glyph{font-family:var(--ipa);font-size:4.5rem;line-height:1;color:var(--accent)}
.start h1{margin:6px 0 10px}
.start p{color:var(--muted);margin:0 0 22px}
@media (min-width:600px){.choice{min-height:130px;font-size:4rem}.choices{gap:16px}}
@media (prefers-reduced-motion:no-preference){.choice,.replay,.primary{transition:background .15s,border-color .15s,transform .1s}.choice:active:not(:disabled){transform:scale(.97)}}
.modes{border:0;padding:0;margin:0 0 22px;display:flex;flex-direction:column;gap:10px;text-align:left}
.modes legend{color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;padding:0}
.mode{display:flex;gap:12px;align-items:center;border:2px solid var(--line);border-radius:14px;padding:12px 14px;min-height:60px;cursor:pointer}
.mode:has(input:checked){border-color:var(--accent);background:var(--bg)}
.mode input{width:22px;height:22px;accent-color:var(--accent)}
.mode small{display:block;color:var(--muted)}
#posWrap{width:100%;display:flex;flex-direction:column;align-items:center;gap:10px}
.choices.pos .choice{font-family:system-ui,sans-serif;font-size:1.2rem;font-weight:600;min-height:76px;padding:16px 8px 8px}
.result{width:100%;display:flex;justify-content:center}
#rchart{width:100%;max-width:560px;height:auto}
.cht .v.hl-good .hit,.cht .v.hl-good .hit{fill:var(--good);stroke:var(--good)}
.cht .v.hl-bad .hit,.cht .v.hl-bad .hit{fill:var(--bad);stroke:var(--bad)}
.v.hl-good text,.v.hl-bad text{fill:#fff!important}
.cht .grid,.cht .grid{stroke:var(--line);stroke-width:1.5;fill:none}
.cht .dash,.cht .dash{stroke-dasharray:4 5}
.cht .lbl{fill:var(--muted);font:600 12px system-ui,sans-serif}
.cht .v{cursor:pointer;outline:none}
.cht .v .hit{fill:var(--card);stroke:var(--line);stroke-width:3}
.cht .v text{font-family:var(--ipa);font-size:23px;fill:var(--ink);text-anchor:middle;dominant-baseline:central;pointer-events:none}
.scorebar{font-size:1.1rem}

/* ---- difficulty, modes, new quiz kinds ---- */
.levels{border:0;padding:0;margin:0 0 18px;text-align:left}
.levels legend{color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;padding:0}
.levelgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.level{display:flex;gap:10px;align-items:center;border:2px solid var(--line);border-radius:14px;padding:10px 12px;min-height:60px;cursor:pointer}
.level:has(input:checked){border-color:var(--accent);background:var(--bg)}
.level input{width:20px;height:20px;accent-color:var(--accent);flex:none}
.level small{display:block;color:var(--muted);font-size:.78rem;line-height:1.25}
.modelist{display:flex;flex-direction:column;gap:10px}
.ghost{color:var(--ink)}.danger{color:var(--bad)}
.top .ghost{background:var(--card)}
.qbody{width:100%;display:flex;flex-direction:column;align-items:center;gap:14px}
.choices[data-n="6"]{grid-template-columns:repeat(3,1fr);gap:8px}
.choices[data-n="6"] .choice{min-height:92px;font-size:2.6rem}
.choices[data-n="8"]{grid-template-columns:repeat(4,1fr);gap:8px}
.choices[data-n="8"] .choice{min-height:84px;font-size:2.1rem}
.choices.name[data-n]{grid-template-columns:1fr 1fr;gap:10px}
.choices.name[data-n] .choice{font-family:system-ui,sans-serif;font-size:1.05rem;font-weight:600;line-height:1.2;min-height:76px;padding:24px 8px 8px;text-align:center}
.choices.name[data-n="8"] .choice{min-height:68px}
.choices.rev[data-n]{grid-template-columns:1fr 1fr;gap:10px}
.revcell{display:flex;gap:6px;min-width:0}
.revcell .choice{min-height:84px;font-family:system-ui,sans-serif}
.revcell .aud{flex:1;font-size:1.7rem;font-weight:700;gap:6px;color:var(--accent);min-width:0}
.revcell .aud svg{flex:none}
.revcell .aud .rv{font-family:var(--ipa);color:var(--ink)}
.revcell .pick{flex:none;width:76px;font-size:.9rem;font-weight:600;padding:0 4px}
.choices[data-n="8"].rev .pick{width:64px}
.revprompt{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%}
.revsym{font-family:var(--ipa);font-size:5rem;line-height:1.1;color:var(--accent)}
#pchart{width:100%;max-width:300px;height:auto;pointer-events:none}
#tapWrap{width:100%;display:flex;justify-content:center}
#tchart,#schart{width:100%;max-width:640px;height:auto;user-select:none;-webkit-user-select:none}
.cht .v.heat .hit{stroke:var(--line)}
.cht .v.heat text{fill:#111}
.cht .v.dim{opacity:.45}
.endcard{width:100%;background:var(--card);border:1px solid var(--line);border-radius:20px;padding:26px 20px;text-align:center;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:10px;align-items:center}
.endcard h2{margin:0}
.endcard .big{font-size:3.4rem;font-weight:800;line-height:1;color:var(--accent)}
.endcard p{margin:0;color:var(--muted)}
.endcard .row{justify-content:center}
.endcard .primary{min-width:200px}
.feedback .close{color:#d97706;font-weight:700}
.totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;width:100%}
.totals>div{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:8px;text-align:center;font-size:1.3rem;box-shadow:var(--shadow)}
.totals small{display:block;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.06em}
.sh{align-self:flex-start;font-size:1rem;margin:8px 0 0;color:var(--muted)}
.tblwrap{width:100%;overflow-x:auto}
table.stt{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--line);border-radius:12px;font-size:.95rem}
.stt th,.stt td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--line)}
.stt th{color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}
.stt .sy{font-family:var(--ipa);font-size:1.4rem}
.stt td.acc{font-weight:700;color:#111;text-align:center;min-width:56px}
@media (max-width:420px){.stt .nm{display:none}.revsym{font-size:4rem}}
.choices.rev[data-n] .pick{font-size:.85rem;font-weight:600;line-height:1.1;width:72px;padding:20px 2px 4px;min-height:84px}
.choices.rev[data-n] .aud{font-size:1.5rem;min-height:84px}
.choices.rev[data-n="8"] .pick{width:64px}

/* ---- IPA trainer: sections, menu, HUD, chips, gamification ---- */
:root{--warn:#d97706;--gold:#f59e0b}
.hud{max-width:760px;margin:0 auto;padding:4px 16px 0;display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
.seg{display:flex;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:3px;gap:2px}
.seg button{border:0;background:none;padding:8px 14px;border-radius:9px;min-height:44px;font-weight:700;color:var(--muted)}
.seg button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink)}
.seg.big{width:100%;margin:0 0 12px}.seg.big button{flex:1;font-size:1.05rem}
.hudlv{flex:1;min-width:200px;display:flex;align-items:center;gap:8px;font-size:.85rem;color:var(--muted)}
.hudlv .lv{font-weight:800;color:var(--accent)}.hudlv .ttl{font-weight:600;color:var(--ink);white-space:nowrap}
.hudlv .xpn{white-space:nowrap}
.bar{height:12px;background:var(--bg);border:1px solid var(--line);border-radius:8px;overflow:hidden;width:100%}
.bar.sm{height:8px;flex:1;min-width:30px}
.bar i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),#ec4899);border-radius:8px;transition:width .4s}
.start-card{padding-bottom:20px}
.start h1{font-size:1.6rem}
.start-glyph{font-size:3.2rem}
.lvlcard,.profhead{background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:12px 14px;margin:0 0 12px;text-align:left;display:flex;flex-direction:column;gap:6px;width:100%}
.profhead{background:var(--card);box-shadow:var(--shadow)}
.plevel{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.plevel .lv{font-weight:800;color:var(--accent)}.plevel b{font-size:1.15rem}
.plevel .dst{margin-left:auto;font-size:.85rem;color:var(--muted);font-weight:600}
.plevel .dst.on{color:var(--warn)}
.pmeta{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:.8rem}
.pills{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.pill{border:2px solid var(--line);background:var(--card);border-radius:12px;min-height:46px;font-weight:700;padding:4px}
.pill[aria-pressed=true]{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
.lvdesc{margin:6px 0 12px!important;font-size:.85rem}
.cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.gcard{position:relative;text-align:left;border:2px solid var(--line);background:var(--card);border-radius:16px;padding:12px 12px 12px;min-height:112px;display:flex;flex-direction:column;gap:2px;box-shadow:var(--shadow)}
.gcard:hover{border-color:var(--accent)}
.gcard b{font-size:1rem}.gcard small{color:var(--muted);font-size:.78rem;line-height:1.25}
.gic{font-family:var(--ipa);font-size:1.5rem;line-height:1;width:38px;height:38px;border-radius:12px;background:var(--bg);color:var(--accent);display:flex;align-items:center;justify-content:center;margin-bottom:4px;font-weight:700}
.gbest{position:absolute;top:10px;right:10px;font-size:.7rem;font-weight:700;color:var(--warn);background:var(--bg);border-radius:8px;padding:2px 7px}
.gcard.daily{flex-direction:row;align-items:center;gap:12px;width:100%;min-height:76px;border-color:var(--gold);background:linear-gradient(135deg,var(--card),var(--bg))}
.gcard.daily .gic{margin:0;background:var(--gold);color:#fff;flex:none}
.gcard.daily .dtx{display:flex;flex-direction:column;flex:1;padding-right:48px}
.opts{display:flex;flex-wrap:wrap;gap:6px 18px;justify-content:center;margin:14px 0 4px}
.opts label,.chk{display:flex;align-items:center;gap:8px;min-height:36px;color:var(--muted);font-size:.9rem;flex-direction:row!important}
.opts input,.chk input{width:20px;height:20px;accent-color:var(--accent)}
.kbdhint{margin:6px 0 0!important;font-size:.78rem}
.start p.hint{margin-bottom:0}
.chtwrap{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
.chtwrap .cht{display:block;margin:0 auto}
.cht.wide,#vchart.wide,#tchart.wide,#schart.wide{max-width:none;min-width:660px;width:100%}
.cht .cell{fill:var(--card);stroke:var(--line);stroke-width:1}
.cht .cell.alt{fill:var(--bg)}
.cht .cell.hl-good{fill:var(--good-bg);stroke:var(--good);stroke-width:2}
.cht .cell.hl-bad{fill:var(--bad-bg)}
.cht .grid.soft{opacity:.5;stroke-width:1}
.cht .v .hit{stroke-width:2.5}
.cht rect.hit{fill:transparent}
.cht .v.heat rect.hit{stroke:var(--line)}
.cht .v.hl-good rect.hit{fill:var(--good);stroke:var(--good)}
.cht .v.hl-bad rect.hit{fill:var(--bad);stroke:var(--bad)}
.cht .v.sel rect.hit{fill:var(--accent);stroke:var(--accent)}
.cht .v text{font-size:21px}
.cht .v.hl-good text,.cht .v.hl-bad text{fill:#fff}
.choices.mp{grid-template-columns:1fr 1fr}
.choices.mp .choice{min-height:140px;font-size:4.2rem}
.featwrap{width:100%;display:flex;flex-direction:column;gap:10px}
.frow{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:10px 12px}
.frow.active{border-color:var(--accent)}
.flab{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:8px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{position:relative;min-height:48px;padding:6px 14px 6px 28px;border:2px solid var(--line);background:var(--bg);border-radius:999px;font-weight:600;font-size:1rem}
.chip .k{position:absolute;left:10px;top:50%;transform:translateY(-50%);font-size:.7rem;color:var(--muted);font-weight:600}
.chip:hover:not(:disabled){border-color:var(--accent)}
.chip:disabled{cursor:default;opacity:.55}
.chip.correct{opacity:1;background:var(--good-bg);border-color:var(--good);color:var(--good)}
.chip.wrong{opacity:1;background:var(--bad-bg);border-color:var(--bad);color:var(--bad)}
.feedback{min-height:110px}
.feedback .cheer{color:var(--accent);font-weight:600;margin-top:2px}
.feedback .xpgain,.xpgain{color:var(--warn);font-weight:800;font-size:.9rem;margin-left:6px}
.endcard p.xpgain{margin:0}
.feedback .other.g{color:var(--good)}.feedback .other.r{color:var(--bad)}
.mpbtns{display:flex;gap:10px;justify-content:center;margin-top:6px}
.mpbtns .ghost{font-family:var(--ipa);font-size:1.3rem;min-width:84px}
.mpbtns small{font:600 .6em system-ui,sans-serif;color:var(--muted);margin-right:4px}
.cmp{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px;width:100%}
.cmpbtn{flex:1 1 140px;min-width:0;min-height:52px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font-weight:600;font-size:.95rem;color:var(--ink);background:var(--card);border-width:2px}
.cmpbtn .cl{font-size:.9rem;white-space:nowrap}
.cmpbtn .vsym{font-family:var(--ipa);font-size:1.5rem;line-height:1}
.cmpbtn svg{flex:none;color:var(--accent)}
.cmpbtn.pick{border-color:var(--bad)}.cmpbtn.corr{border-color:var(--good)}
.cmpbtn.ab{flex:1 1 100%;color:var(--accent);border-color:var(--accent)}
.cmpbtn:active{background:var(--bg)}
@media (max-width:380px),(hover:none){.cmpbtn kbd{display:none}.cmpbtn{padding:8px 6px}}
.endcard .grid{font-size:1.3rem;letter-spacing:2px;color:var(--ink)}
.totals-wrap{width:100%}
.totals-wrap .totals{margin-bottom:6px}
h3.sh{margin:10px 0 6px}
.badges{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;width:100%}
.badge{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:2px;opacity:.5;filter:grayscale(1)}
.badge.got{opacity:1;filter:none;border-color:var(--gold);box-shadow:var(--shadow)}
.badge .bi{font-family:var(--ipa);width:40px;height:40px;border-radius:50%;background:var(--bg);display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--accent);margin-bottom:4px;font-size:1rem}
.badge.got .bi{background:var(--gold);color:#fff}
.badge b{font-size:.9rem}.badge small{color:var(--muted);font-size:.72rem;line-height:1.25}
#fx{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:40}
#fx i{position:absolute;top:-14px;width:9px;height:14px;border-radius:2px;animation:fall 2.1s ease-in forwards}
@keyframes fall{to{transform:translate(var(--dx),105vh) rotate(var(--r));opacity:.9}}
.toast{position:fixed;left:50%;top:max(12px,env(safe-area-inset-top));transform:translateX(-50%);z-index:50;max-width:calc(100vw - 32px);background:var(--accent);color:var(--accent-ink);padding:12px 18px;border-radius:14px;font-weight:700;text-align:center;box-shadow:0 6px 24px rgba(0,0,0,.3)}
.toast.t-badge{background:var(--gold);color:#1d1b2e}
@media (prefers-reduced-motion:no-preference){.toast{animation:pop .35s ease-out}.bar i{transition:width .4s}}
@keyframes pop{from{transform:translateX(-50%) scale(.8);opacity:0}to{transform:translateX(-50%) scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){#fx{display:none}.bar i{transition:none}}
@media (min-width:600px){.cards{grid-template-columns:repeat(3,1fr)}.start-card{max-width:640px}}
@media (max-width:420px){.chip{font-size:.95rem;padding-right:12px}.hudlv{min-width:0;flex-basis:100%}}

/* ---- Match-up ---- */
.matchwrap{width:100%;display:flex;flex-direction:column;align-items:center;gap:12px}
.mhint{text-align:center;min-height:1.4em}
.mboard{display:grid;grid-template-columns:minmax(78px,.34fr) minmax(0,1fr);gap:12px;width:100%}
.mcol{min-width:0}
.mh{margin:0 0 6px;font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.mlist{display:flex;flex-direction:column;gap:8px}
.msnd,.mcard{position:relative;border:2px solid var(--line);background:var(--card);border-radius:14px;box-shadow:var(--shadow);min-height:60px;width:100%}
.msnd{display:flex;align-items:center;justify-content:center;gap:6px;color:var(--accent);font-weight:800;font-size:1.3rem;padding:4px 6px}
.msnd svg{flex:none;width:22px;height:22px}
.msnd .rv{font-family:var(--ipa);color:var(--ink);font-size:1.3rem}
.mcard{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:0;text-align:left;padding:6px 34px 6px 28px;color:var(--ink)}
.mcard .k{position:absolute;top:6px;left:9px;font:600 .75rem system-ui,sans-serif;color:var(--muted)}
.mcard .msym{font-family:var(--ipa);font-size:1.9rem;line-height:1.1;font-weight:600}
.mcard .mnm{font-size:.88rem;line-height:1.2;color:var(--muted);overflow-wrap:anywhere}
.mcard .mlt{position:absolute;top:50%;right:10px;transform:translateY(-50%);font-weight:800;color:var(--good)}
.msnd:hover,.mcard:hover{border-color:var(--accent)}
.msnd.sel{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.msnd.sel .rv{color:var(--accent-ink)}
.msnd.locked,.mcard.locked{background:var(--good-bg);border-color:var(--good);color:var(--good)}
.msnd.locked .rv,.mcard.locked .msym,.mcard.locked .mnm{color:var(--good)}
.mcard.locked,.mcard.locked:hover,.msnd.locked:hover{border-color:var(--good)}
.mcard.locked{cursor:default}
.msnd.bad:not(.locked),.mcard.bad:not(.locked){background:var(--bad-bg);border-color:var(--bad)}
.mcard.bad:not(.locked) .msym,.mcard.bad:not(.locked) .mnm{color:var(--bad)}
.msnd.bad:not(.locked){color:var(--bad)}
#mEnd .stars{font-size:3rem;line-height:1;color:var(--gold);letter-spacing:4px}
#mEnd .stars .off{color:var(--line)}
#mEnd b{color:var(--ink)}
@media (prefers-reduced-motion:no-preference){
  .msnd.pop,.mcard.pop{animation:mpop .45s ease-out}
  .msnd.bad,.mcard.bad{animation:mshake .45s}
  .mcard.nudge{animation:mshake .35s}
  .msnd,.mcard{transition:background .15s,border-color .15s}
}
@keyframes mpop{0%{transform:scale(1)}40%{transform:scale(1.07)}100%{transform:scale(1)}}
@keyframes mshake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
@media (max-width:360px){.mboard{gap:8px}.mcard{padding-right:28px}.mcard .msym{font-size:1.6rem}.mcard .mnm{font-size:.8rem}}
.mcard .msym{margin-bottom:2px}

/* credits / footer (public build) */
body.no-extras #extrasRow,body.no-extras #extraRow{display:none!important}
.foot{text-align:center;color:var(--muted);font-size:.8rem;padding:18px 16px calc(18px + env(safe-area-inset-bottom));max-width:720px;margin:0 auto}
.foot a,.cbody a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
.aboutbtn{margin-top:14px;font-size:.9rem;min-height:44px}
.credits{z-index:30}
.credits-card{text-align:left;max-width:680px;position:relative}
.credits .cbody p{margin:0 0 12px;font-size:.92rem;line-height:1.45}
.credits .cbody h1{font-size:1.4rem;margin:0 0 10px;padding-right:80px}
.credits .cbody h3{margin:20px 0 8px;font-size:1rem;border-bottom:1px solid var(--line);padding-bottom:4px}
.credits .closebtn{position:absolute;top:16px;right:16px;min-height:44px;padding:8px 16px}
.clist{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.crow{display:flex;gap:12px;align-items:flex-start;padding:8px 10px;border:1px solid var(--line);border-radius:12px}
.csym{font-family:var(--ipa);font-size:1.6rem;min-width:2.1rem;text-align:center;color:var(--accent);line-height:1.2}
.cinfo{display:flex;flex-direction:column;gap:1px;min-width:0;font-size:.85rem;overflow-wrap:anywhere}
.cinfo span{color:var(--muted)}

/* ---- Place the symbol ---- */
.hear{display:inline-flex;align-items:center;gap:6px;color:var(--accent);font-weight:600;min-height:44px}
#revPrompt .hear svg{flex:none}
.cht .pl{cursor:pointer;outline:none}
.cht .pl .phit{fill:transparent;stroke:none}
.cht .pl .pdot{fill:var(--accent);fill-opacity:0;stroke:var(--accent);stroke-opacity:.75;stroke-width:2;transition:fill-opacity .12s,stroke-width .12s}
.cht .pl .pdot.tint{fill-opacity:.09}
.cht .pl:hover .pdot{fill-opacity:.22;stroke-opacity:1;stroke-width:3}
.cht .pl:active .pdot{fill-opacity:.4;stroke-opacity:1;stroke-width:3}
.cht .pl:focus-visible .pdot{fill-opacity:.25;stroke-opacity:1;stroke-width:3.5}
.cht .pl:focus-visible .phit{stroke:var(--accent);stroke-width:2;stroke-dasharray:3 3}
@media (prefers-reduced-motion:reduce){.cht .pl .pdot{transition:none}}
#tchart{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#placeHint{max-width:520px}
#tapWrap{justify-content:flex-start}
#tchart.wide.placing{min-width:716px}

/* ---- Non-pulmonic / Other symbols sections ---- */
.gprof{display:contents}
.hud .seg{max-width:100%;overflow-x:auto;scrollbar-width:none}
.hud .seg::-webkit-scrollbar{display:none}
.hud .seg button{flex:1 1 auto;white-space:nowrap}
.seg.big{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.seg.big button{min-width:0}
@media (max-width:420px){.hud .seg button{padding:8px 9px;font-size:.88rem}}
@media (max-width:350px){.hud .seg button{padding:8px 6px;font-size:.8rem}.seg{gap:1px}}
@media (max-width:350px){.pills{gap:4px}.pill{min-width:0;font-size:.9rem;padding:4px 2px}}

/* ---- Learning path, trouble pairs, coach ---- */
.lscreen{position:fixed;inset:0;z-index:11;background:var(--bg);overflow-y:auto;padding:16px;padding-bottom:40px}
.lcard{margin:0 auto;width:100%;max-width:560px;display:flex;flex-direction:column;gap:12px}
.lcard p{margin:0}
.lhead{display:flex;align-items:center;gap:10px}
.lhead h2{margin:0;font-size:1.2rem;flex:1;min-width:0;overflow-wrap:anywhere}
.lhead .ghost{background:var(--card);flex:none}
.lrow{display:flex;flex-wrap:wrap;gap:8px;margin:0}
.lrow .lbtn{flex:1 1 150px}
.lbtn{min-height:48px;font-weight:600}
.lbtn:disabled{opacity:.5}
.lsym,.lbig,.lsyms,.chipsyms,.lplay .lsym{font-family:var(--ipa)}
.lstages{display:flex;flex-direction:column;gap:10px}
.lstage{display:flex;gap:12px;align-items:flex-start;text-align:left;border:2px solid var(--line);background:var(--card);border-radius:16px;padding:12px;box-shadow:var(--shadow);width:100%}
.lstage.rec{border-color:var(--accent)}
.lstage.m{border-color:var(--good)}
.lstage .ln{flex:none;width:34px;height:34px;border-radius:50%;background:var(--bg);color:var(--accent);font-weight:800;display:flex;align-items:center;justify-content:center}
.lstage.m .ln{background:var(--good);color:#fff}
.lstage .lt{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.lstage small{color:var(--muted)}
.chipsyms{display:flex;flex-wrap:wrap;gap:4px}
.chipsyms i{font-style:normal;background:var(--bg);border-radius:8px;padding:1px 8px;font-size:1.25rem}
.meter{position:relative;height:10px;background:var(--bg);border:1px solid var(--line);border-radius:8px;overflow:hidden}
.meter i{display:block;height:100%;background:var(--accent);border-radius:8px}
.meter.done i{background:var(--good)}
.meter b{position:absolute;left:90%;top:0;bottom:0;width:2px;background:var(--ink);opacity:.35}
.lsyms{display:flex;flex-wrap:wrap;gap:8px;font-size:2.4rem;color:var(--accent);margin:0}
.lcardx{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.lbig{font-size:5.5rem;line-height:1.1;color:var(--accent)}
.lplay.big{min-width:160px}
.lname{font-weight:700;font-size:1.1rem}
.ldesc{color:var(--ink);text-align:left;width:100%}
.lex{width:100%;text-align:left;color:var(--muted)}
.lex b{color:var(--ink)}
.lfig{margin:0;width:100%;max-width:300px}
.lfig figcaption{font-size:.85rem;color:var(--muted)}
.mouth{width:100%;height:auto}
.mouth .cav{fill:none;stroke:var(--muted);stroke-width:3}
.mouth .tng{fill:#f0a0a0;fill-opacity:.55;stroke:#d97979;stroke-width:2}
.mouth .lip{fill:#e07a8a}
.mouth .mk{fill:var(--accent);stroke:var(--card);stroke-width:2}
.mouth .ax{fill:var(--muted);font:600 9px system-ui,sans-serif}
.lsay{align-self:flex-start;text-align:left}
.lnav .lbtn{flex:1 1 140px}
.lempty,.plan,.area{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:8px}
.plan h3{margin:0}.plan h3 small{color:var(--muted);font-weight:400}
.plan ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.plan li{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.plan li>div{display:flex;flex-direction:column;flex:1 1 180px;min-width:0}
.plan li small{color:var(--muted)}
.plan li .lbtn{flex:none;min-width:90px}
.areas{display:flex;flex-direction:column;gap:10px}
.area h4{margin:0;font-size:1.05rem}
.area.conf{border-left:5px solid var(--bad)}.area.feat{border-left:5px solid var(--warn)}.area.weak{border-left:5px solid var(--gold)}.area.learn{border-left:5px solid var(--accent)}.area.habit{border-left:5px solid var(--muted)}
.area .ev{color:var(--muted)}
.area .tip{background:var(--bg);border-radius:10px;padding:8px 10px}
.tlist{display:flex;flex-direction:column;gap:10px}
.trow{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:8px}
.trow .tx{font-size:1.1rem}.trow .tx b{font-family:var(--ipa);font-size:1.6rem;color:var(--accent)}
.trow small{display:block;color:var(--muted);font-size:.85rem}
.tb{display:flex;flex-wrap:wrap;gap:8px}
.tb .lplay{min-width:84px;font-size:1.1rem}.tb .lplay em{font-style:normal;font-size:.7rem;color:var(--muted)}
.tb .lbtn{flex:1 1 140px}
.lplay{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px}
.lplay.ghost{background:var(--card)}
.mcs ul{margin:4px 0 8px;padding-left:20px}.mcs li{margin:2px 0}
.mcs .lsym{font-size:1.3rem}
.custbar{width:100%;background:var(--card);border:1px solid var(--accent);border-radius:14px;padding:8px 12px;display:flex;flex-direction:column;gap:4px}
.custbar .cbt{display:flex;gap:8px;align-items:center;justify-content:space-between}
.custbar .cbt b{min-width:0;overflow-wrap:anywhere}
.custbar small{color:var(--muted)}
.plinks{width:100%}.plinks .ghost{flex:1 1 140px;background:var(--card)}
.gcard.daily.learn{border-color:var(--accent)}
.gcard.daily.learn .gic{background:var(--accent)}
.gcard.daily.learn .gbest{color:var(--accent)}
.gcard.daily.coach .gic{background:var(--good)}
.gcard.daily.coach .dtx{padding-right:0}
.cards.tools{margin:0;grid-template-columns:1fr 1fr}
.start-card>.gcard.daily{margin-bottom:10px}
@media (min-width:600px){.cards.tools{grid-template-columns:1fr 1fr}}
.lcard h2:focus{outline:none}

/* explore after answering */
.xplore{width:100%;display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center}
.xplore[hidden]{display:none}
.xplore .xhint{margin:0}
.xcap{margin:0;min-height:1.6em;font-weight:600;font-size:.95rem;overflow-wrap:anywhere}
.xcap .xs{font-family:var(--ipa);font-size:1.3rem}
.xcap .xst{color:var(--accent);font-weight:700;white-space:nowrap}
.xnear{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center}
.xnear .xnl{font-size:.9rem;color:var(--muted)}
.xnear .xn{font-family:var(--ipa);font-size:1.4rem;min-width:52px;min-height:46px}
.cht .xring{fill:none;stroke:var(--ink);stroke-width:3;pointer-events:none}
.choice.xplay{cursor:pointer}
.choice.xplay::after{content:"\25B6";position:absolute;top:8px;right:12px;font:.8rem/1 system-ui,sans-serif;color:var(--accent)}
.choice.xplay:not(.correct):not(.wrong){opacity:.92}
.choice.xsel{box-shadow:0 0 0 3px var(--muted)}

/* ---- My list + Pick a pair ---- */
.gcard.daily.mylist{border-color:var(--accent);background:linear-gradient(135deg,var(--card),var(--bg));margin-bottom:10px}
.gcard.daily.mylist .gic{background:var(--accent);color:var(--accent-ink)}
.gcard.daily.mylist .gbest{color:var(--accent)}
.gcard.daily.pairc{border-color:var(--good);margin-bottom:10px}
.gcard.daily.pairc .gic{background:var(--good);color:#fff}
.gcard.daily.pairc .gbest{color:var(--good)}
.gcard.daily.mylist .dtx,.gcard.daily.pairc .dtx{padding-right:44px}
.choices[data-n="3"],.choices[data-n="5"]{grid-template-columns:repeat(3,1fr);gap:8px}
.choices[data-n="3"] .choice,.choices[data-n="5"] .choice{min-height:92px;font-size:2.6rem}
.choices[data-n="7"]{grid-template-columns:repeat(4,1fr);gap:8px}
.choices[data-n="7"] .choice{min-height:84px;font-size:2.1rem}
.choices[data-n="2"] .choice{min-height:130px;font-size:4rem}
.mllist{display:flex;flex-direction:column;gap:12px}
.mlc{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:8px}
.mlt{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.mln{font-size:1.1rem;overflow-wrap:anywhere}
.mlt small,.mlb span{color:var(--muted);font-size:.85rem}
.mlsyms{display:flex;flex-wrap:wrap;gap:4px;font-family:var(--ipa)}
.mlsyms i{font-style:normal;background:var(--bg);border-radius:8px;padding:1px 8px;font-size:1.3rem}
.mlsyms i.more{font-family:system-ui,sans-serif;font-size:.9rem;color:var(--muted);align-self:center}
.mlsyms.big{gap:6px}
.mlsyms.big .ghost{font-family:var(--ipa);font-size:1.7rem;min-width:52px;min-height:52px;padding:4px 10px;background:var(--card)}
.mlb{display:flex;flex-direction:column;gap:4px}
.mlacts .lbtn{flex:1 1 90px;min-height:44px}
.mlacts .lbtn.primary{flex:1 1 100%}
.mlren{display:flex;flex-wrap:wrap;gap:8px}
.mlren .pkname{flex:1 1 180px}
.mlask{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.mlask span{flex:1 1 100%;font-weight:600}
.mlask .lbtn{flex:1 1 120px}
.mlgames .gcard:disabled{opacity:.5}
.hint.warn{color:var(--bad)}.hint.okmsg{color:var(--good)}
.pkl{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:.9rem;color:var(--muted)}
.pkname,.pktext textarea{width:100%;box-sizing:border-box;padding:12px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink);font:inherit;font-size:1.1rem;min-height:48px}
.pktext textarea{font-family:var(--ipa);font-size:1.3rem;resize:vertical}
.pktext{display:flex;flex-direction:column;gap:8px}
.pktext label{font-weight:600;font-size:.9rem;color:var(--muted)}
.pkbar{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;gap:8px;align-items:center;background:var(--card);border:1px solid var(--accent);border-radius:14px;padding:8px 10px;box-shadow:var(--shadow)}
.pkbar b{font-size:1rem}.pkbar .sp{flex:1}
.pkbar button{min-height:44px;padding:8px 12px}
.pksel{display:flex;flex-wrap:wrap;gap:6px;align-items:center;max-height:150px;overflow-y:auto}
.pkh{color:var(--muted);font-size:.85rem;flex:1 1 100%}
.pkchip{min-width:52px;min-height:52px;padding:4px 10px;border:2px solid var(--line);background:var(--card);color:var(--ink);border-radius:12px;font-family:var(--ipa);font-size:1.6rem;line-height:1;display:inline-flex;align-items:center;justify-content:center;gap:4px}
.pkchip[aria-pressed=true],.pkchip.on{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
.pkchip em{font-style:normal;font-family:system-ui,sans-serif;font-size:.9rem;opacity:.8}
.pkchip:hover{border-color:var(--accent)}
.pkchip.sug{border-color:var(--good)}
.pksec{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:4px 10px 10px}
.pksec summary{cursor:pointer;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:700}
.pksec summary small{color:var(--muted);font-weight:500}
.pkcnt{color:var(--accent);font-size:.85rem;font-weight:700}
.pkacts{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.pkacts .ghost{flex:1 1 130px;min-height:44px}
.pkgrid,.pksugs{display:flex;flex-wrap:wrap;gap:6px}
.pkpair{display:flex;align-items:flex-start;justify-content:center;gap:10px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:12px;box-shadow:var(--shadow)}
.pks{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.pks small{color:var(--muted);font-size:.78rem;line-height:1.2;overflow-wrap:anywhere}
.pkslot{min-width:72px;min-height:72px;border:2px dashed var(--line);border-radius:16px;background:var(--bg);font-family:var(--ipa);font-size:2.6rem;line-height:1;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;padding:4px 8px}
.pkslot.on{border-style:solid;border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
.pkvs{align-self:center;color:var(--muted);font-weight:700}
.pksug .hint{margin:0 0 6px}
@media (max-width:360px){.pkchip{min-width:48px;min-height:48px;font-size:1.45rem}.pkbar button{padding:8px 8px;font-size:.9rem}}

/* ---- All sounds section ---- */
.seg.big[data-n="5"]{grid-template-columns:repeat(6,minmax(0,1fr))}
.seg.big[data-n="5"] button{grid-column:span 2;font-size:.88rem;padding:8px 2px;line-height:1.15}
.seg.big[data-n="5"] button:nth-child(n+4){grid-column:span 3}
.chartfam{width:100%;max-width:560px}
.chartfam button{flex:1 1 0;min-width:0;border:0;background:none;padding:8px 6px;border-radius:9px;min-height:44px;font-weight:700;color:var(--muted)}
.chartfam button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink)}
.allnote{margin:0 0 10px}
@media (max-width:440px){.hud .seg button{padding:8px 7px;font-size:.84rem}}
@media (max-width:350px){.hud .seg button{padding:8px 4px;font-size:.74rem}}
.seg.big button .sm{display:none}
@media (max-width:400px){.seg.big[data-n="5"] button .lg{display:none}.seg.big[data-n="5"] button .sm{display:inline}}
@media (max-width:350px){.pill{font-size:.8rem}}
.drillbtn{width:100%;margin-top:8px;min-height:44px}
.drillbtn .vsym{font-family:var(--ipa)}
