:root{
  --bg:#faf7ff;
  --surface:#ffffff;
  --ink:#241b3a;
  --ink-soft:#6b6382;
  --line:#e9e2fb;
  --purple:#6b2fe0;
  --purple-soft:#f1e9ff;
  --blue:#1e7feb;
  --blue-soft:#e6f1ff;
  --green:#16b37f;
  --green-soft:#e3f8f0;
  --orange:#ff8a2b;
  --orange-soft:#fff1e2;
  --red:#e94b5b;
  --red-soft:#ffe9ec;
  --r-s:12px; --r-m:18px; --r-l:28px;
  --shadow:0 10px 24px -14px rgba(50,22,110,.35);
  --rail:252px;
  --pop:cubic-bezier(.34,1.56,.64,1);
}
*{box-sizing:border-box}
html,body{margin:0}
html{scroll-behavior:smooth}
body{
  background:var(--bg);
  color:var(--ink);
  font:400 17px/1.6 Nunito,system-ui,sans-serif;
  -webkit-text-size-adjust:100%;
  padding-bottom:env(safe-area-inset-bottom);
}
body.big-type{font-size:19px}
h1,h2,h3,h4,.num,.btn,.brand-name{font-family:"Baloo 2",Nunito,system-ui,sans-serif;font-weight:700;line-height:1.15}
h1{font-size:clamp(28px,4.4vw,44px);margin:0 0 .3em;letter-spacing:-.5px}
h2{font-size:clamp(22px,2.6vw,29px);margin:0 0 .4em;letter-spacing:-.3px}
h3{font-size:20px;margin:0 0 .3em}
p{margin:0 0 1em;max-width:66ch}
a{color:var(--purple)}
button{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--purple);outline-offset:3px;border-radius:6px}
.skip{position:absolute;left:-9999px;top:8px;background:#fff;padding:10px 16px;border-radius:12px;z-index:60}
.skip:focus{left:12px}

/* ---------- top bar ---------- */
.topbar{
  position:sticky;top:0;z-index:40;
  display:flex;align-items:center;gap:14px;
  padding:10px clamp(14px,3vw,28px);
  background:rgba(250,247,255,.92);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink)}
.brand-mark{
  width:36px;height:36px;border-radius:11px;background:var(--purple);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg stroke='%23fff' stroke-width='9' stroke-linecap='round' stroke-linejoin='round' fill='none'%3E%3Cpath d='M22 82 L50 24 L78 82 L22 82'/%3E%3C/g%3E%3C/svg%3E");
  background-size:100%;
}
.brand-name{font-size:23px;letter-spacing:-.4px}
.stats{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 12px;border-radius:999px;font-weight:700;font-size:15px;white-space:nowrap;
  background:var(--surface);border:1px solid var(--line);
}
.chip b{font-family:"Baloo 2",sans-serif;font-size:17px}
.chip.fire{background:var(--orange-soft);border-color:#ffd9b5;color:#a84f00}
.chip.xp{background:var(--green-soft);border-color:#b9ecd8;color:#0a7a56}
.chip.lv{background:var(--purple-soft);border-color:#dfceff;color:#4d1bab}
.menu-btn{display:none;background:none;border:0;padding:8px;cursor:pointer}
.menu-btn span{display:block;width:22px;height:2.5px;border-radius:2px;background:var(--ink);margin:4px 0}

/* ---------- layout ---------- */
.shell{display:flex;align-items:flex-start;max-width:1320px;margin:0 auto}
.rail{
  position:sticky;top:57px;flex:0 0 var(--rail);width:var(--rail);
  height:calc(100vh - 57px);overflow:auto;padding:18px 14px 28px;
}
.rail ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px}
.rail a{
  display:flex;align-items:center;gap:12px;
  padding:11px 14px;border-radius:14px;text-decoration:none;color:var(--ink);
  font-weight:700;font-size:16px;
}
.rail a:hover{background:#f2ecff}
.rail a[aria-current="page"]{background:var(--purple);color:#fff}
.rail-foot{margin:22px 14px 0;font-size:13px;color:var(--ink-soft);line-height:1.5}
main{flex:1 1 auto;min-width:0;padding:clamp(18px,3vw,34px) clamp(14px,3vw,30px) 120px}

.ic{width:22px;height:22px;flex:0 0 22px;background:currentColor;
  -webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}
.ic-home{-webkit-mask-image:var(--m-home);mask-image:var(--m-home)}
.ic-learn{-webkit-mask-image:var(--m-learn);mask-image:var(--m-learn)}
.ic-abc{-webkit-mask-image:var(--m-abc);mask-image:var(--m-abc)}
.ic-num{-webkit-mask-image:var(--m-num);mask-image:var(--m-num)}
.ic-build{-webkit-mask-image:var(--m-build);mask-image:var(--m-build)}
.ic-mic{-webkit-mask-image:var(--m-mic);mask-image:var(--m-mic)}
.ic-book{-webkit-mask-image:var(--m-book);mask-image:var(--m-book)}
.ic-star{-webkit-mask-image:var(--m-star);mask-image:var(--m-star)}
.ic-chart{-webkit-mask-image:var(--m-chart);mask-image:var(--m-chart)}
.ic-gear{-webkit-mask-image:var(--m-gear);mask-image:var(--m-gear)}
:root{
  --m-home:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21H3z'/%3E%3Cpath d='M9.5 21v-6h5v6'/%3E%3C/svg%3E");
  --m-learn:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='18' cy='12' r='3'/%3E%3Ccircle cx='8' cy='19' r='3'/%3E%3Cpath d='M8.8 7.5 15 10.6M15.6 14.4 10.6 17.6'/%3E%3C/svg%3E");
  --m-abc:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19 10 5l6 14M6.4 14h7.2M19 19V9'/%3E%3C/svg%3E");
  --m-num:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 4v16M12 4v16M18 4v16'/%3E%3C/svg%3E");
  --m-build:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='8' height='8' rx='2'/%3E%3Crect x='13' y='13' width='8' height='8' rx='2'/%3E%3Crect x='13' y='3' width='8' height='8' rx='2'/%3E%3C/svg%3E");
  --m-mic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='9' y='2.5' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7'/%3E%3C/svg%3E");
  --m-book:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6a2 2 0 0 1 2 2v14a2 2 0 0 0-2-2H4z'/%3E%3Cpath d='M20 4h-6a2 2 0 0 0-2 2v14a2 2 0 0 1 2-2h6z'/%3E%3C/svg%3E");
  --m-star:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l2.7 5.6 6.1.8-4.4 4.3 1.1 6-5.5-3-5.5 3 1.1-6L3.2 9.9l6.1-.8z'/%3E%3C/svg%3E");
  --m-chart:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 20V11M10 20V4M16 20v-6M22 20H2'/%3E%3C/svg%3E");
  --m-gear:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Cpath d='M12 2.6v2.6M12 18.8v2.6M4.4 12H1.8M22.2 12h-2.6M6.6 6.6 4.8 4.8M19.2 19.2l-1.8-1.8M17.4 6.6l1.8-1.8M4.8 19.2l1.8-1.8'/%3E%3C/svg%3E");
}

/* ---------- tab bar (phones) ---------- */
.tabbar{display:none}

/* ---------- cards & buttons ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-l);padding:clamp(18px,2.4vw,26px);box-shadow:var(--shadow)}
.grid{display:grid;gap:14px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  padding:14px 26px;border:0;border-radius:16px;cursor:pointer;
  background:var(--purple);color:#fff;font-size:18px;
  box-shadow:0 4px 0 #4e1cae;transition:transform .08s,box-shadow .08s,filter .15s;
  text-decoration:none;
}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:translateY(3px);box-shadow:0 1px 0 #4e1cae}
.btn.green{background:var(--green);box-shadow:0 4px 0 #0e8a61}
.btn.green:active{box-shadow:0 1px 0 #0e8a61}
.btn.orange{background:var(--orange);box-shadow:0 4px 0 #cc6a14;color:#3a1d00}
.btn.orange:active{box-shadow:0 1px 0 #cc6a14}
.btn.ghost{background:var(--surface);color:var(--purple);border:2px solid var(--line);box-shadow:0 4px 0 var(--line)}
.btn.ghost:active{box-shadow:0 1px 0 var(--line)}
.btn[disabled]{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none}
.btn.small{padding:9px 16px;font-size:16px;border-radius:12px;box-shadow:0 3px 0 rgba(0,0,0,.18)}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.muted{color:var(--ink-soft)}
.small{font-size:15px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- glyph ---------- */
.glyph{display:block;overflow:visible}
.glyph path,.glyph polyline,.glyph circle{
  fill:none;stroke:currentColor;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;
}
.glyph .solid{fill:currentColor;stroke:none}
.glyph.draw path,.glyph.draw polyline,.glyph.draw circle{
  stroke-dasharray:460;stroke-dashoffset:460;
  animation:draw .75s ease forwards;
}
@keyframes draw{to{stroke-dashoffset:0}}

.tile{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  background:var(--surface);border:2px solid var(--line);border-radius:var(--r-m);
  padding:14px 8px 10px;cursor:pointer;color:var(--purple);text-align:center;
  transition:transform .12s var(--pop),border-color .12s,background .12s;
}
.tile:hover{transform:translateY(-3px);border-color:#cdb4ff}
.tile .cap{font-family:"Baloo 2",sans-serif;font-size:19px;color:var(--ink)}
.tile .sub{font-size:13px;color:var(--ink-soft)}
.letters{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:12px}

/* ---------- hero ---------- */
.hero{
  position:relative;overflow:hidden;
  border-radius:var(--r-l);padding:clamp(22px,4vw,44px);
  background:linear-gradient(150deg,#7a3bf0,#5420c4 60%,#3d1596);
  color:#fff;box-shadow:0 18px 40px -22px rgba(60,20,150,.75);
}
.hero h1{color:#fff}
.hero p{color:#e6dcff;font-size:clamp(16px,1.6vw,19px)}
.hero .row{margin-top:6px}
.hero .btn.ghost{background:#fff;border-color:#fff;box-shadow:0 4px 0 #cbb4f5}
.hero-art{
  position:absolute;right:-10px;top:0;bottom:0;width:46%;
  display:grid;grid-template-columns:repeat(3,1fr);align-content:center;gap:2px;
  color:rgba(255,255,255,.17);pointer-events:none;
}
.hero-art svg{width:100%;height:auto}
.hero-inner{position:relative;max-width:34rem}
.banner-glyphs{display:flex;gap:10px;margin-bottom:16px;color:#fff}
.banner-glyphs svg{width:clamp(34px,5vw,52px);height:auto}

/* ---------- path ---------- */
.day{margin:28px 0 8px}
.day-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.day-badge{
  display:grid;place-items:center;width:46px;height:46px;border-radius:14px;
  background:var(--purple);color:#fff;font-family:"Baloo 2",sans-serif;font-size:20px;flex:0 0 auto;
}
.day.blue .day-badge{background:var(--blue)} .day.green .day-badge{background:var(--green)} .day.orange .day-badge{background:var(--orange);color:#3a1d00}
.trail{display:flex;flex-direction:column;gap:8px;padding-left:4px}
.node{display:flex;align-items:center;gap:16px}
.node:nth-child(2){margin-left:clamp(0px,6vw,64px)}
.node:nth-child(3){margin-left:clamp(0px,12vw,128px)}
.medal{
  position:relative;width:78px;height:78px;flex:0 0 78px;border:0;cursor:pointer;
  border-radius:50%;background:var(--purple);color:#fff;
  box-shadow:0 6px 0 #4e1cae;display:grid;place-items:center;
  transition:transform .12s var(--pop);
}
.medal:hover{transform:translateY(-3px)}
.medal:active{transform:translateY(4px);box-shadow:0 2px 0 #4e1cae}
.node.blue .medal{background:var(--blue);box-shadow:0 6px 0 #1560b4}
.node.green .medal{background:var(--green);box-shadow:0 6px 0 #0e8a61}
.node.orange .medal{background:var(--orange);box-shadow:0 6px 0 #cc6a14;color:#3a1d00}
.medal svg{width:42px;height:42px}
.node .medal.locked,.node.blue .medal.locked,.node.green .medal.locked,.node.orange .medal.locked{
  background:#e8e2f5;color:#b3a9ca;box-shadow:0 6px 0 #d8d0e8;cursor:not-allowed}
.node .medal.locked:hover{transform:none}
.medal.done::after{
  content:"";position:absolute;right:-4px;bottom:-2px;width:28px;height:28px;border-radius:50%;
  background:var(--green) var(--m-check) center/16px no-repeat;border:3px solid var(--bg);
}
:root{--m-check:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4.5 4.5L19 7'/%3E%3C/svg%3E")}
.node-label .nm{font-family:"Baloo 2",sans-serif;font-size:19px}
.node-label .meta{font-size:14px;color:var(--ink-soft)}

/* ---------- progress bars ---------- */
.bar{height:14px;border-radius:999px;background:#ece5fb;overflow:hidden}
.bar i{display:block;height:100%;border-radius:999px;background:var(--green);transition:width .5s ease}
.bar.purple i{background:var(--purple)}
.bar.orange i{background:var(--orange)}
.bar.thin{height:9px}

/* ---------- quiz ---------- */
.quiz{max-width:760px;margin:0 auto}
.quiz-top{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.quiz-top .bar{flex:1}
.x-btn{background:none;border:0;font-size:26px;line-height:1;cursor:pointer;color:var(--ink-soft);padding:4px 8px}
.hearts{display:flex;gap:4px;font-size:19px}
.prompt{font-family:"Baloo 2",sans-serif;font-size:clamp(20px,2.6vw,26px);margin-bottom:6px}
.hint{color:var(--ink-soft);margin-bottom:18px;font-size:16px}
.stage{display:grid;place-items:center;min-height:180px;color:var(--purple);margin-bottom:6px}
.stage svg{width:clamp(120px,24vw,190px);height:auto}
.stage .word{font-family:"Baloo 2",sans-serif;font-size:clamp(30px,6vw,52px);color:var(--ink);letter-spacing:1px}
.stage .glyphword{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;color:var(--purple)}
.stage .glyphword svg{width:clamp(38px,7vw,62px)}
.options{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-top:10px}
.opt{
  background:var(--surface);border:2px solid var(--line);border-bottom-width:4px;border-radius:16px;
  padding:16px 14px;cursor:pointer;font-family:"Baloo 2",sans-serif;font-size:20px;color:var(--ink);
  display:grid;place-items:center;gap:6px;min-height:72px;transition:border-color .12s,background .12s,transform .1s;
}
.opt:hover{border-color:#cdb4ff;background:#fbf8ff}
.opt[aria-pressed="true"]{border-color:var(--purple);background:var(--purple-soft)}
.opt.good{border-color:var(--green);background:var(--green-soft)}
.opt.bad{border-color:var(--red);background:var(--red-soft)}
.opt svg{width:56px;height:56px;color:var(--purple)}
.typebox{
  width:100%;padding:16px 18px;border:2px solid var(--line);border-radius:16px;font:inherit;font-size:20px;
  background:var(--surface);color:var(--ink);
}
.typebox:focus{border-color:var(--purple);outline:none}
.feedback{
  position:sticky;bottom:0;margin-top:26px;padding:18px clamp(14px,3vw,22px);
  border-radius:var(--r-m);display:none;align-items:flex-start;gap:14px;
}
.feedback.show{display:flex;animation:rise .25s var(--pop)}
.feedback.ok{background:var(--green-soft);color:#065c41}
.feedback.no{background:var(--red-soft);color:#8e1726}
.feedback h3{margin:0 0 2px;font-size:21px}
.feedback .btn{margin-left:auto;flex:0 0 auto}
@keyframes rise{from{transform:translateY(14px);opacity:0}to{transform:none;opacity:1}}
.fb-ico{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;flex:0 0 40px;background:var(--green);color:#fff;font-size:22px}
.feedback.no .fb-ico{background:var(--red)}

/* ---------- builder ---------- */
.slots{display:flex;flex-wrap:wrap;gap:10px;min-height:92px;padding:14px;border:2px dashed var(--line);border-radius:var(--r-m);background:var(--surface);align-items:center}
.slot{width:62px;height:62px;border-radius:14px;background:var(--purple-soft);display:grid;place-items:center;color:var(--purple)}
.slot svg{width:42px;height:42px}
.bank{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.bank button{width:68px;height:68px;border-radius:16px;border:2px solid var(--line);border-bottom-width:4px;background:var(--surface);color:var(--purple);cursor:pointer;display:grid;place-items:center}
.bank button:hover{border-color:#cdb4ff}
.bank button[disabled]{opacity:.3}
.bank button svg{width:42px;height:42px}

/* ---------- dictionary / tables ---------- */
.search{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.search input,.search select{
  padding:13px 16px;border:2px solid var(--line);border-radius:14px;font:inherit;background:var(--surface);color:var(--ink);
}
.search input{flex:1 1 220px}
.search input:focus,.search select:focus{border-color:var(--purple);outline:none}
.words{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:12px}
.word-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-m);padding:16px;display:flex;flex-direction:column;gap:8px}
.word-card .oc{font-family:"Baloo 2",sans-serif;font-size:24px;color:var(--purple)}
.word-card .en{font-weight:700}
.word-card .say{font-size:14px;color:var(--ink-soft);font-style:italic}
.word-card .gw{display:flex;gap:5px;flex-wrap:wrap;color:var(--ink);opacity:.8}
.word-card .gw svg{width:26px;height:26px}
.word-card .tools{display:flex;gap:8px;margin-top:auto;flex-wrap:wrap}
.icon-btn{border:2px solid var(--line);background:var(--surface);border-radius:12px;padding:7px 12px;cursor:pointer;font-size:15px;font-weight:700;color:var(--purple);display:inline-flex;gap:6px;align-items:center}
.icon-btn:hover{border-color:#cdb4ff}
.icon-btn.on{background:var(--purple);border-color:var(--purple);color:#fff}
.tag{display:inline-block;padding:3px 10px;border-radius:999px;background:var(--blue-soft);color:#13518f;font-size:13px;font-weight:700}

/* ---------- misc blocks ---------- */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-m);padding:16px}
.stat .num{font-size:30px;display:block;color:var(--purple)}
.stat .lbl{font-size:14px;color:var(--ink-soft)}
.ach{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.ach-card{display:flex;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-m);padding:14px;opacity:.5}
.ach-card.got{opacity:1;border-color:#ffd9b5;background:var(--orange-soft)}
.ach-card .badge{width:52px;height:52px;flex:0 0 52px;border-radius:50%;display:grid;place-items:center;background:var(--purple-soft);color:var(--purple)}
.ach-card.got .badge{background:var(--orange);color:#fff}
.ach-card .badge svg{width:30px;height:30px}
.ach-card .nm{font-family:"Baloo 2",sans-serif;font-size:17px}
.ach-card .d{font-size:14px;color:var(--ink-soft)}
.week{display:flex;gap:8px;flex-wrap:wrap}
.week div{flex:1 1 44px;text-align:center;font-size:13px;color:var(--ink-soft)}
.week i{display:block;height:46px;border-radius:12px;background:#ece5fb;margin-bottom:5px}
.week i.on{background:var(--green)}
.rules li{margin-bottom:10px}
.pron{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.syll{padding:8px 14px;border-radius:12px;background:var(--purple-soft);color:#4d1bab;font-family:"Baloo 2",sans-serif;font-size:19px}
.switch{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--line)}
.switch:last-child{border-bottom:0}
.switch .lbl{font-weight:700}
.switch .d{font-size:14px;color:var(--ink-soft)}
.toggle{width:58px;height:32px;border-radius:999px;border:0;background:#ddd5ee;position:relative;cursor:pointer;flex:0 0 58px}
.toggle::after{content:"";position:absolute;top:3px;left:3px;width:26px;height:26px;border-radius:50%;background:#fff;transition:left .18s var(--pop)}
.toggle[aria-checked="true"]{background:var(--green)}
.toggle[aria-checked="true"]::after{left:29px}
.seg{display:inline-flex;border:2px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surface)}
.seg button{border:0;background:none;padding:10px 16px;cursor:pointer;font-weight:700}
.seg button[aria-pressed="true"]{background:var(--purple);color:#fff}
/* glyph word strips (declared after .stage so sizes win where nested) */
.gw{display:flex;gap:7px;flex-wrap:wrap;align-items:center;color:var(--purple)}
.stage .gw svg,.gw svg{width:32px;height:32px;flex:0 0 auto}
.word-card .gw svg{width:26px;height:26px}
.empty{text-align:center;padding:40px 20px;color:var(--ink-soft)}
.empty svg{width:64px;color:#cbbbf0;margin-bottom:10px}

/* ---------- toasts & confetti ---------- */
.toast-wrap{position:fixed;left:50%;transform:translateX(-50%);bottom:86px;z-index:70;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{background:var(--ink);color:#fff;padding:12px 20px;border-radius:999px;font-weight:700;box-shadow:var(--shadow);animation:pop .3s var(--pop)}
@keyframes pop{from{transform:scale(.8) translateY(10px);opacity:0}to{transform:none;opacity:1}}
.spark{position:fixed;width:10px;height:10px;border-radius:3px;z-index:65;pointer-events:none;animation:fall 1.1s ease-out forwards}
@keyframes fall{to{transform:translate(var(--dx),70vh) rotate(540deg);opacity:0}}

/* ---------- section head ---------- */
.head{margin-bottom:18px}
.head p{margin-bottom:0}
.sec{margin-top:34px}

@media (max-width:980px){
  .shell{display:block}
  .rail{
    position:fixed;top:57px;left:0;bottom:0;width:272px;z-index:45;background:var(--surface);
    border-right:1px solid var(--line);transform:translateX(-100%);transition:transform .22s ease;height:auto;
  }
  body.nav-open .rail{transform:none}
  body.nav-open::after{content:"";position:fixed;inset:57px 0 0;background:rgba(36,27,58,.4);z-index:44}
  .menu-btn{display:block}
  main{padding-bottom:96px}
  .tabbar{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:46;
    background:rgba(255,255,255,.97);border-top:1px solid var(--line);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));backdrop-filter:blur(8px);
  }
  .tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 2px;
    text-decoration:none;color:var(--ink-soft);font-size:11.5px;font-weight:700}
  .tabbar a[aria-current="page"]{color:var(--purple)}
  .hero-art{display:none}
  .toast-wrap{bottom:92px}
  .feedback{bottom:64px;z-index:47;box-shadow:0 -8px 20px -14px rgba(50,22,110,.5)}
}
@media (max-width:560px){
  .brand-name{display:none}
  .chip .t{display:none}
  .stats{gap:6px}
  .node:nth-child(2),.node:nth-child(3){margin-left:0}
  .medal{width:66px;height:66px;flex-basis:66px}
  .medal svg{width:36px;height:36px}
  .feedback{flex-wrap:wrap}
  .feedback .btn{width:100%;margin-left:0}
  .options{grid-template-columns:1fr 1fr}
  .feedback{bottom:64px;z-index:47;box-shadow:0 -8px 20px -14px rgba(50,22,110,.5)}
}
@media (prefers-reduced-motion:reduce),(prefers-reduced-motion){
  *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
  html{scroll-behavior:auto}
}
body.calm *{animation:none!important;transition:none!important}
