:root {
  --green: #58cc02; --green-d: #58a700; --green-bg: #d7ffb8; --green-t: #58a700;
  --blue: #1cb0f6; --blue-d: #1899d6; --blue-bg: #ddf4ff;
  --red: #ff4b4b; --red-d: #ea2b2b; --red-bg: #ffdfe0; --red-t: #ea2b2b;
  --gold: #ffc800; --gold-d: #e5a400;
  --orange: #ff9600; --purple: #ce82ff;
  --bg: #ffffff; --surface: #ffffff; --soft: #f7f7f7;
  --border: #e5e5e5; --text: #4b4b4b; --title: #3c3c3c; --muted: #afafaf; --locked: #e5e5e5; --locked-d: #b7b7b7;
  --hanzi: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  --green-bg: #2b3d19; --green-t: #79d634; --blue-bg: #1b3a4b; --red-bg: #3f2326; --red-t: #ff7878;
  --bg: #131f24; --surface: #131f24; --soft: #202f36;
  --border: #37464f; --text: #dce6ec; --title: #f1f7fb; --muted: #6f8691; --locked: #37464f; --locked-d: #263239;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 700;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.hz { font-family: var(--hanzi); font-weight: 600; }
#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- splash ---------- */
.splash { flex: 1; display: grid; place-items: center; align-content: center; gap: 24px; }
.splash-panda { width: 110px; height: 110px; animation: bob 1.6s ease-in-out infinite; }
.dots { display: flex; gap: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { background: var(--border); } 50% { background: var(--green); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; padding: 14px 16px; border-radius: 16px;
  font-size: 15px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: #fff; background: var(--green); box-shadow: 0 4px 0 var(--green-d);
  transition: transform .05s, box-shadow .05s, filter .1s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-d); }
.btn.red { background: var(--red); box-shadow: 0 4px 0 var(--red-d); }
.btn.gold { background: var(--gold); box-shadow: 0 4px 0 var(--gold-d); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--blue); }
.btn.outline { background: var(--surface); color: var(--blue); border: 2px solid var(--border); box-shadow: 0 4px 0 var(--border); }
.btn.white { background: #fff; color: var(--c, var(--green)); box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.btn:disabled { background: var(--locked); color: var(--muted); box-shadow: 0 4px 0 var(--locked-d); cursor: default; }
:root[data-theme="dark"] .btn:disabled { box-shadow: none; }

/* ---------- main shell ---------- */
.view { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 24px; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--bg); border-bottom: 2px solid var(--border);
}
.stat { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; }
.stat .ic { font-size: 22px; line-height: 1; }
.stat.off { color: var(--muted); } .stat.off .ic { filter: grayscale(1); opacity: .5; }
.stat.fire { color: var(--orange); } .stat.xp { color: var(--gold-d); } .stat.flag { color: var(--muted); }
.tabbar {
  display: flex; border-top: 2px solid var(--border); background: var(--bg);
  padding: 6px 8px calc(6px + var(--safe-b));
}
.tab { flex: 1; display: grid; place-items: center; padding: 6px 0; border-radius: 12px; border: 2px solid transparent; }
.tab .ic { font-size: 26px; line-height: 1; filter: grayscale(1); opacity: .55; transition: transform .15s; }
.tab.on { background: var(--blue-bg); border-color: var(--blue); }
.tab.on .ic { filter: none; opacity: 1; transform: scale(1.08); }

/* ---------- path ---------- */
.unit { padding: 16px 16px 8px; }
.unit-banner {
  background: var(--c); color: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 4px 0 var(--cd); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.unit-banner .t { font-size: 13px; opacity: .85; text-transform: uppercase; letter-spacing: .8px; font-weight: 800; }
.unit-banner .s { font-size: 18px; font-weight: 800; margin-top: 2px; }
.unit-banner .book { font-size: 26px; padding: 8px 10px; border-radius: 12px; border: 2px solid rgba(0,0,0,.15); }
.nodes { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 0 10px; gap: 22px; }
.node-wrap.open { z-index: 10; }
.node-wrap.cur { margin-top: 40px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.node {
  position: relative; width: 70px; height: 64px; border-radius: 50%;
  background: var(--c); box-shadow: 0 7px 0 var(--cd); display: grid; place-items: center;
  font-size: 30px; color: #fff; transition: transform .06s, box-shadow .06s;
}
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cd); }
.node svg { width: 34px; height: 34px; }
.node.locked { background: var(--locked); box-shadow: 0 7px 0 var(--locked-d); color: var(--locked-d); }
:root[data-theme="dark"] .node.locked { color: #52656d; }
.node.current::before {
  content: ""; position: absolute; inset: -12px -12px -19px; border-radius: 50%;
  border: 7px solid var(--border); pointer-events: none;
}
.node.current::after {
  content: ""; position: absolute; inset: -12px -12px -19px; border-radius: 50%;
  border: 7px solid transparent; border-top-color: var(--c); border-right-color: var(--c); transform: rotate(-45deg);
  pointer-events: none; opacity: var(--ring, 0);
}
.bubble {
  position: absolute; bottom: calc(100% + 18px); white-space: nowrap; z-index: 2;
  background: var(--surface); color: var(--c); border: 2px solid var(--border); border-radius: 12px;
  padding: 8px 12px; font-size: 14px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase;
  animation: bounce 1.4s ease-in-out infinite;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 12px; height: 12px; background: var(--surface);
  border-right: 2px solid var(--border); border-bottom: 2px solid var(--border); transform: translate(-50%, -6px) rotate(45deg);
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.mascot { position: absolute; width: 88px; height: 88px; top: 38%; pointer-events: none; }
.mascot.l { left: 2%; } .mascot.r { right: 2%; }
.pop {
  position: absolute; top: calc(100% + 18px); width: min(300px, calc(100vw - 32px)); z-index: 6;
  background: var(--c); color: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 4px 0 var(--cd);
  animation: popin .15s ease-out;
}
.pop::before {
  content: ""; position: absolute; left: calc(50% - var(--dx, 0px)); top: -8px; width: 16px; height: 16px;
  background: var(--c); transform: translateX(-50%) rotate(45deg);
}
.pop.locked { background: var(--soft); color: var(--muted); box-shadow: 0 0 0 2px var(--border); }
.pop.locked::before { background: var(--soft); border-left: 2px solid var(--border); border-top: 2px solid var(--border); }
.pop h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.pop p { margin: 0 0 14px; font-size: 15px; opacity: .92; }
.pop .hzs { font-family: var(--hanzi); font-size: 20px; letter-spacing: 4px; }
@keyframes popin { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.course-end { text-align: center; color: var(--muted); padding: 24px 16px 8px; }

/* ---------- pages ---------- */
.page { padding: 20px 16px; }
.page h1 { margin: 0 0 4px; font-size: 24px; font-weight: 900; color: var(--title); }
.page .sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.card { border: 2px solid var(--border); border-radius: 16px; padding: 16px; background: var(--surface); }
.hero { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.hero .p { width: 84px; height: 84px; flex: none; }
.hero h2 { margin: 0 0 4px; font-size: 19px; font-weight: 900; color: var(--title); }
.hero p { margin: 0; color: var(--muted); font-size: 15px; }
.section-t { margin: 26px 0 10px; font-size: 20px; font-weight: 900; color: var(--title); }
.wlist { border: 2px solid var(--border); border-radius: 16px; overflow: hidden; }
.wrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; }
.wrow + .wrow { border-top: 2px solid var(--border); }
.wrow .hz { font-size: 26px; min-width: 58px; color: var(--title); }
.wrow .m { flex: 1; min-width: 0; }
.wrow .py { color: var(--blue); font-size: 14px; }
.wrow .tr { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: flex; gap: 3px; align-items: flex-end; }
.bars i { width: 5px; border-radius: 2px; background: var(--border); }
.bars i:nth-child(1) { height: 8px; } .bars i:nth-child(2) { height: 12px; } .bars i:nth-child(3) { height: 16px; } .bars i:nth-child(4) { height: 20px; }
.bars i.on { background: var(--gold); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .p { width: 110px; height: 110px; margin: 0 auto 10px; }

.lb { border: 2px solid var(--border); border-radius: 16px; overflow: hidden; }
.lbrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.lbrow + .lbrow { border-top: 2px solid var(--border); }
.lbrow.me { background: var(--blue-bg); }
.lbrow .rk { width: 28px; text-align: center; font-weight: 900; color: var(--muted); font-size: 16px; }
.lbrow .rk.m { font-size: 22px; }
.lbrow .nm { flex: 1; font-size: 16px; color: var(--title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbrow .x { color: var(--muted); font-weight: 800; }
.ava {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 18px; background: var(--ac, var(--blue)); overflow: hidden; position: relative;
}
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.league { text-align: center; margin-bottom: 18px; }
.league .cup { font-size: 64px; line-height: 1; filter: drop-shadow(0 4px 0 var(--gold-d)); }
.league h1 { margin-top: 8px; }

.profile-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid var(--border); }
.profile-head .ava { width: 76px; height: 76px; font-size: 32px; }
.profile-head h1 { margin: 0; }
.profile-head .sub { margin: 2px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sbox { border: 2px solid var(--border); border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.sbox .ic { font-size: 26px; }
.sbox b { display: block; font-size: 19px; font-weight: 900; color: var(--title); }
.sbox span { font-size: 13px; color: var(--muted); }
.goal-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  flex: 1; min-width: 70px; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--border);
  box-shadow: 0 3px 0 var(--border); text-align: center; font-weight: 800;
}
.chip small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.chip.on { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); box-shadow: 0 3px 0 var(--blue); }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 10px 4px 0; position: relative; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart .bar { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: var(--border); min-height: 4px; }
.chart .bar.ok { background: var(--gold); }
.chart .d { font-size: 12px; color: var(--muted); }
.chart .goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--orange); opacity: .6; }
.goal-card { display: flex; align-items: center; gap: 14px; }
.ring { width: 64px; height: 64px; flex: none; }
.ring circle { fill: none; stroke-width: 8; }
.ring .bg { stroke: var(--border); } .ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .6s; }

/* ---------- lesson ---------- */
.lesson { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; }
.lhead { display: flex; align-items: center; gap: 14px; padding: 14px 16px 6px; }
.lhead .x { font-size: 26px; color: var(--muted); width: 28px; line-height: 1; }
.progress { flex: 1; height: 16px; border-radius: 8px; background: var(--border); overflow: hidden; }
.progress i {
  display: block; height: 100%; border-radius: 8px; background: var(--green); transition: width .4s cubic-bezier(.3,1.4,.6,1);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); position: relative; min-width: 16px;
}
.progress i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); }
.hearts { color: var(--red); font-weight: 900; font-size: 17px; display: flex; gap: 4px; align-items: center; }
.hearts .ic { font-size: 22px; }
.hearts.hit { animation: shake .4s; }
.combo { text-align: center; height: 22px; color: var(--orange); font-weight: 900; font-size: 14px; letter-spacing: .5px; text-transform: uppercase; }
.lbody { flex: 1; overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; }
.lbody > * { animation: slidein .25s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
.prompt { font-size: 22px; font-weight: 900; color: var(--title); margin: 8px 0 18px; line-height: 1.25; }
.tag-new { display: inline-flex; gap: 6px; align-items: center; color: var(--purple); font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; margin-top: 6px; }
.lfoot { padding: 14px 16px calc(16px + var(--safe-b)); border-top: 2px solid var(--border); transition: background .15s; }
.lfoot.ok { background: var(--green-bg); border-color: transparent; }
.lfoot.bad { background: var(--red-bg); border-color: transparent; }
.fb { display: none; align-items: flex-start; gap: 12px; margin-bottom: 14px; animation: fbup .2s ease-out; }
.lfoot.ok .fb, .lfoot.bad .fb { display: flex; }
.fb .badge { width: 56px; height: 56px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 900; }
.lfoot.ok .fb .badge { color: var(--green); } .lfoot.bad .fb .badge { color: var(--red); }
.fb h4 { margin: 4px 0 2px; font-size: 22px; font-weight: 900; }
.lfoot.ok .fb h4 { color: var(--green-t); } .lfoot.bad .fb h4 { color: var(--red-t); }
.fb .ans { font-size: 16px; color: var(--red-t); }
.fb .ans .hz { font-size: 20px; }
.fb .extra { font-size: 15px; color: var(--green-t); }
@keyframes fbup { from { transform: translateY(14px); opacity: 0; } }

.speaker {
  width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--blue); box-shadow: 0 4px 0 var(--blue-d);
  display: grid; place-items: center; color: #fff;
}
.speaker:active { transform: translateY(4px); box-shadow: none; }
.speaker svg { width: 32px; height: 32px; }
.speaker.sm { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 3px 0 var(--blue-d); }
.speaker.sm svg { width: 22px; height: 22px; }
.speaker.big { width: 120px; height: 120px; border-radius: 28px; box-shadow: 0 6px 0 var(--blue-d); }
.speaker.big svg { width: 60px; height: 60px; }
.speaker.playing svg { animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }

.qword { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.qword .panda { width: 90px; height: 90px; flex: none; }
.speech {
  position: relative; border: 2px solid var(--border); border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.speech::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; background: var(--bg);
  border-left: 2px solid var(--border); border-bottom: 2px solid var(--border); transform: translateY(-50%) rotate(45deg);
}
.speech .hz { font-size: 40px; color: var(--title); line-height: 1.1; }
.speech .py { color: var(--muted); font-size: 15px; }
.speech .ru { font-size: 18px; color: var(--title); }

.opts { display: flex; flex-direction: column; gap: 12px; }
.opts.grid { display: grid; grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; min-height: 60px;
  border: 2px solid var(--border); border-radius: 16px; box-shadow: 0 4px 0 var(--border); background: var(--surface);
  font-size: 17px; color: var(--title); transition: transform .05s;
}
.opt:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--border); }
.opts.grid .opt { flex-direction: column; justify-content: center; text-align: center; min-height: 110px; gap: 4px; }
.opt .n {
  width: 28px; height: 28px; flex: none; border-radius: 8px; border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 14px; color: var(--muted);
}
.opts.grid .opt .n { display: none; }
.opt .hz { font-size: 40px; line-height: 1.1; }
.opt .py { font-size: 20px; }
.opt.sel { border-color: var(--blue); background: var(--blue-bg); box-shadow: 0 4px 0 var(--blue); color: var(--blue); }
.opt.sel .n { border-color: var(--blue); color: var(--blue); }
.opt.right { border-color: var(--green); background: var(--green-bg); box-shadow: 0 4px 0 var(--green); color: var(--green-t); }
.opt.wrong { border-color: var(--red); background: var(--red-bg); box-shadow: 0 4px 0 var(--red); color: var(--red-t); animation: shake .35s; }
.opt.gone { opacity: .35; pointer-events: none; box-shadow: 0 4px 0 var(--border); border-color: var(--border); background: var(--surface); color: var(--muted); }
.locked-opts .opt { pointer-events: none; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: flex; flex-direction: column; gap: 12px; }
.match .opt { justify-content: center; text-align: center; min-height: 64px; font-size: 16px; padding: 10px; }
.match .opt .hz { font-size: 30px; }
.listen-box { display: flex; justify-content: center; margin: 10px 0 30px; gap: 16px; align-items: flex-end; }

.intro-card { border: 2px solid var(--border); border-radius: 20px; padding: 22px 18px; text-align: center; }
.intro-card .hz { font-size: 84px; color: var(--title); line-height: 1.1; }
.intro-card .py { font-size: 24px; color: var(--blue); margin: 4px 0 6px; }
.intro-card .ru { font-size: 20px; color: var(--title); }
.intro-card .say { display: flex; justify-content: center; margin-top: 16px; }
.example { margin-top: 16px; border: 2px solid var(--border); border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.example .hz { font-size: 20px; color: var(--title); }
.example .tr { font-size: 15px; color: var(--muted); margin-top: 2px; }
.note { margin-top: 12px; background: var(--soft); border-radius: 16px; padding: 12px 14px; font-size: 15px; line-height: 1.4; display: flex; gap: 10px; }

/* ---------- result screens ---------- */
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 16px; gap: 12px; }
.result .p { width: 150px; height: 150px; animation: hop .9s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-14px) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }
.result h1 { margin: 10px 0 0; font-size: 28px; font-weight: 900; color: var(--gold-d); }
.result h1.red { color: var(--red); }
.result p { margin: 0; color: var(--muted); font-size: 17px; max-width: 320px; }
.rstats { display: flex; gap: 10px; width: 100%; max-width: 380px; margin-top: 18px; }
.rstat { flex: 1; border-radius: 16px; border: 2px solid var(--rc); background: var(--rc); overflow: hidden; animation: popin .3s ease-out backwards; }
.rstat:nth-child(2) { animation-delay: .15s; } .rstat:nth-child(3) { animation-delay: .3s; }
.rstat .h { color: #fff; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; padding: 4px 0; }
.rstat .v { background: var(--bg); border-radius: 13px; padding: 12px 4px; font-size: 20px; font-weight: 900; color: var(--rc); }
.streak-big { font-size: 110px; line-height: 1; filter: drop-shadow(0 6px 0 #e07a00); animation: hop 1.2s ease-in-out infinite; }
.streak-num { font-size: 72px; font-weight: 900; color: var(--orange); line-height: 1; }
.weekdots { display: flex; gap: 8px; margin-top: 14px; border: 2px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.weekdots div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.weekdots i { width: 30px; height: 30px; border-radius: 50%; background: var(--border); display: grid; place-items: center; font-style: normal; color: #fff; font-size: 15px; }
.weekdots i.on { background: var(--orange); }
.result-foot { padding: 14px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 40;
  background: var(--title); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 15px; animation: popin .2s;
}
.modal-bg { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; animation: fade .15s; }
.modal { width: 100%; background: var(--bg); border-radius: 20px 20px 0 0; padding: 22px 16px calc(16px + var(--safe-b)); text-align: center; animation: fbup .2s; }
.modal .p { width: 100px; height: 100px; margin: 0 auto 6px; }
.modal h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; color: var(--title); }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal .btn + .btn { margin-top: 10px; }
@keyframes fade { from { opacity: 0; } }
