/* LILGEEK — "sticker book" design language: warm paper, ink outlines, chunky press-able shapes. */
:root {
  --ink: #1D1B2F; --ink-2: #4A4760; --muted: #6E6A85;
  --paper: #FFF7E8; --card: #FFFFFF; --line: #1D1B2F;
  --sun: #FFC93C; --sun-2: #FFE7A3;
  --sky: #5BC8FF; --sky-2: #D4F0FF;
  --lime: #7ED957; --lime-2: #DDF6CF;
  --coral: #FF6B5B; --coral-2: #FFD9D4;
  --grape: #9B7BFF; --grape-2: #E8E0FF;
  --pink: #FF8FA3;
  --teal: #3CCFB4; --teal-2: #D2F5EE;
  --bw: 2.5px; --r: 20px; --r-sm: 14px;
  --sh: 0 4px 0 var(--ink); --sh-sm: 0 3px 0 var(--ink);
  --font: 'Baloo Bhaijaan 2', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --nav-h: 72px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper);
  background-image: radial-gradient(rgba(29,27,47,.09) 1.2px, transparent 1.2px); background-size: 22px 22px;
  font-size: 17px; line-height: 1.45; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code, pre { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
[dir="rtl"] .flip { transform: scaleX(-1); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
#app[data-view="welcome"] { max-width: 1120px; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--card); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px; border: var(--bw) solid var(--ink); border-radius: 16px;
  background: var(--bg); box-shadow: var(--sh); font-weight: 800; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease; user-select: none; touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { cursor: not-allowed; }
.btn-primary { --bg: var(--coral); color: #fff; }
.btn-primary:disabled { --bg: #E9E4D8; color: #A29D8C; box-shadow: 0 4px 0 #CFC8B6; border-color: #CFC8B6; }
.btn-sun { --bg: var(--sun); } .btn-sky { --bg: var(--sky); } .btn-lime { --bg: var(--lime); } .btn-coral { --bg: var(--coral); color: #fff; }
.btn-ghost { --bg: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost:active { transform: none; box-shadow: none; }
.btn-off { --bg: #F1ECE0; color: #8D887A; border-color: #CFC8B6; box-shadow: 0 3px 0 #CFC8B6; }
.btn.danger { color: #C2372A; }
.btn-lg { min-height: 60px; font-size: 20px; padding: 12px 30px; border-radius: 18px; }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 15px; border-radius: 12px; box-shadow: var(--sh-sm); }
.btn-block { width: 100%; }
.grow { flex: 1; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: var(--bw) solid var(--ink); background: var(--card); box-shadow: var(--sh-sm); cursor: pointer; text-decoration: none; }
.icon-btn .ic { width: 22px; height: 22px; }
.lang-btn { border: var(--bw) solid var(--ink); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: var(--sh-sm); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); padding: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--sky-2); }
.pill-sun { background: var(--sun); } .pill-lime { background: var(--lime-2); }
.bar { position: relative; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: #F1ECE0; overflow: hidden; }
.bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--lime); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar > i::after { content: ''; position: absolute; inset: 2px 6px auto; height: 3px; border-radius: 3px; background: rgba(255,255,255,.55); }
.bar > span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 800; line-height: 10px; }
.bar-sun > i { background: var(--sun); } .bar-sky > i { background: var(--sky); } .bar-lime > i { background: var(--lime); } .bar-grape > i { background: var(--grape); }
.section-title { font-size: 21px; margin: 28px 4px 12px; }
.page-title { font-size: 28px; margin: 4px 4px 2px; }
.stack { display: grid; gap: 12px; margin-top: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-between .section-title { margin-inline: 4px 0; }

/* ---------- landing ---------- */
.lp { padding: 0 20px 40px; }
.lp-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 22px; text-decoration: none; letter-spacing: -.01em; }
.brand b { color: var(--coral); }
/* Two-line logo: product name with the "by" line underneath. */
.brand-mark { display: inline-grid; justify-items: start; line-height: 1; }
.brand-mark b { color: inherit; font-size: 1em; font-weight: 800; letter-spacing: .04em; }
.brand-mark small { margin-top: 2px; font-size: 9px; font-weight: 700; letter-spacing: .1em; opacity: .7; white-space: nowrap; }
.hero { display: grid; gap: 20px; align-items: center; padding: 18px 0 40px; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 260px; }
.hero-art::before { content: ''; position: absolute; width: 250px; height: 250px; border-radius: 50%; background: var(--sun); border: var(--bw) solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.hero-art .meeko { position: relative; }
.float { position: absolute; padding: 6px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm); font-family: var(--mono); font-size: 14px; font-weight: 700; animation: drift 5s ease-in-out infinite; }
.f1 { top: 8%; inset-inline-start: 4%; background: var(--sky-2); transform: rotate(-6deg); }
.f2 { top: 20%; inset-inline-end: 2%; background: var(--lime-2); animation-delay: -1.5s; }
.f3 { bottom: 6%; inset-inline-start: 12%; background: var(--grape-2); animation-delay: -3s; }
.hero-copy { text-align: center; display: grid; gap: 14px; justify-items: center; }
.hero h1 { font-size: clamp(38px, 9vw, 64px); letter-spacing: -.02em; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 30em; }
.price-note { font-size: 13px; color: var(--muted); }
.lp-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feat { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); padding: 20px; }
.feat h3 { font-size: 20px; margin: 8px 0 4px; }
.feat p { color: var(--ink-2); font-size: 15px; }
.feat-emo { display: grid; place-items: center; width: 52px; height: 52px; font-size: 28px; border: 2px solid var(--ink); border-radius: 14px; }
.feat:nth-child(6n+1) .feat-emo { background: var(--sun-2); } .feat:nth-child(6n+2) .feat-emo { background: var(--sky-2); }
.feat:nth-child(6n+3) .feat-emo { background: var(--lime-2); } .feat:nth-child(6n+4) .feat-emo { background: var(--grape-2); }
.feat:nth-child(6n+5) .feat-emo { background: var(--coral-2); } .feat:nth-child(6n+6) .feat-emo { background: var(--sun-2); }
.tilt-0 { transform: rotate(-.8deg); } .tilt-1 { transform: rotate(.6deg); } .tilt-2 { transform: rotate(-.3deg); }
.lp-how, .hero-copy, .auth, .done-screen, .learn-card, .stage, .sheet { grid-template-columns: minmax(0, 1fr); }
.cell .meeko { min-width: 0; }
.lp-how { margin-top: 44px; text-align: center; display: grid; gap: 18px; justify-items: center; }
.lp-how h2 { font-size: 30px; }
.lp-how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; width: 100%; max-width: 720px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.lp-how li { display: flex; align-items: center; gap: 12px; text-align: start; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--r-sm); padding: 14px; box-shadow: var(--sh-sm); font-weight: 600; }
.lp-how li b { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--coral); color: #fff; border: 2px solid var(--ink); }
.site-foot { margin: 56px -20px 0; padding: 32px 20px 24px; background: var(--ink); color: #EDEAF7; border-radius: 28px 28px 0 0; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-grid { display: grid; gap: 26px; grid-template-columns: 1fr 1fr; }
.foot-brand { grid-column: 1 / -1; display: grid; gap: 10px; justify-items: start; }
.foot-brand .brand { font-size: 24px; color: #fff; }
.foot-brand p { color: #BDB8D3; font-size: 15px; max-width: 34em; }
.foot-brand .lang-btn { background: transparent; color: #fff; border-color: #fff; box-shadow: none; }
.site-foot h3 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--sun); margin-bottom: 10px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-weight: 600; font-size: 15px; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; color: #9E99B8; }
@media (min-width: 760px) {
  .site-foot { margin-inline: 0; border-radius: 28px; padding: 40px; margin-bottom: 24px; }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .foot-brand { grid-column: auto; }
}
.faq { display: grid; gap: 8px; }
.faq details { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 10px 14px; }
.faq summary { font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.legal { display: grid; gap: 10px; color: var(--ink-2); font-size: 15px; }
.fine a { color: inherit; font-weight: 700; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1fr 1.1fr; padding: 40px 0 70px; }
  .hero-art { min-height: 380px; } .hero-art::before { width: 340px; height: 340px; }
  .hero-art .meeko { width: 290px; height: 290px; }
  .hero-copy { text-align: start; justify-items: start; }
}

/* ---------- auth / onboarding ---------- */
.auth { padding: 16px 20px 40px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.auth-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.auth h1 { font-size: 30px; }
.form { width: 100%; text-align: start; display: grid; gap: 12px; margin-top: 10px; }
.form label, .form legend { font-weight: 800; font-size: 15px; }
.form fieldset { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.phone { display: flex; align-items: stretch; border: var(--bw) solid var(--ink); border-radius: 16px; overflow: hidden; background: #fff; }
.phone:focus-within { box-shadow: 0 0 0 4px var(--sky-2); }
.cc { display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--sun-2); border-inline-end: var(--bw) solid var(--ink); font-weight: 800; white-space: nowrap; }
.phone input, .input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: 20px; font-weight: 700; padding: 12px; background: transparent; outline: none; letter-spacing: .04em; }
.input { border: var(--bw) solid var(--ink); border-radius: 16px; background: #fff; font-size: 18px; letter-spacing: 0; }
.input:focus { box-shadow: 0 0 0 4px var(--sky-2); }
.err { color: #C2372A; font-weight: 700; font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; }
.otp { display: flex; gap: 8px; justify-content: center; }
.otp input { flex: 1 1 0; min-width: 0; max-width: 56px; height: 64px; text-align: center; font: 800 30px var(--font); border: var(--bw) solid var(--ink); border-radius: 16px; background: #fff; box-shadow: var(--sh-sm); outline: none; }
.otp input:focus { background: var(--sun-2); }
.demo-hint { text-align: center; font-size: 14px; background: var(--sun-2); border: 2px dashed var(--ink); border-radius: 12px; padding: 6px; font-weight: 700; }
.swatches { display: flex; gap: 12px; }
.swatch { position: relative; width: 52px; height: 52px; border-radius: 50%; border: var(--bw) solid var(--ink); cursor: pointer; box-shadow: var(--sh-sm); }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch:has(input:checked) { outline: 4px solid var(--ink); outline-offset: 3px; }
.swatch:has(input:focus-visible) { outline: 4px solid var(--sky); outline-offset: 3px; }
.sw-green { background: #7ED957; } .sw-blue { background: #6EC8FF; } .sw-orange { background: #FFB259; } .sw-purple { background: #B79BFF; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: grid; text-align: center; padding: 10px 6px; border: var(--bw) solid var(--ink); border-radius: 14px; background: #fff; font-weight: 800; box-shadow: var(--sh-sm); }
.seg small { font-weight: 600; color: var(--muted); font-size: 12px; }
.seg input:checked + span { background: var(--lime); }
.seg-who input:checked + span { background: var(--sun); }
select.input { appearance: none; padding-inline: 12px 28px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231D1B2F' stroke-width='3'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; font-weight: 700; }
[dir="rtl"] select.input { background-position: left 8px center; }

/* Calm mode: grown-up feel — no idle wiggles/bobbing, quieter surfaces. */
body.calm .bob, body.calm .nudge, body.calm .node.cur .node-btn, body.calm .chest.ready .chest-ic, body.calm .bug, body.calm .float { animation: none; }
body.calm { background-image: none; }
body.calm .tilt-0, body.calm .tilt-1, body.calm .tilt-2 { transform: none; }
.seg input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ---------- app shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(255,247,232,.92); backdrop-filter: blur(8px); border-bottom: 2px solid rgba(29,27,47,.08); }
.topbar .brand { font-size: 19px; }
.chips { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font-weight: 800; font-size: 15px; text-decoration: none; box-shadow: 0 2px 0 var(--ink); }
.chip-flame { color: #B9B3A3; } .chip-flame.lit { color: #F2711C; background: #FFF0E0; } .chip-flame b, .chip-gem b, .chip-lvl b { color: var(--ink); }
.chip-gem { color: #3A92D1; } .chip-lvl { color: #E0A800; }
.page { padding: 16px 16px calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; z-index: 30; bottom: 0; inset-inline: 0; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); background: var(--card); border-top: var(--bw) solid var(--ink); }
@media (min-width: 600px) { .tabbar { bottom: 12px; border: var(--bw) solid var(--ink); border-radius: 22px; box-shadow: var(--sh); inset-inline: 12px; } }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; text-decoration: none; font-size: 12px; font-weight: 800; color: var(--muted); }
.tabbar .ic { width: 26px; height: 26px; }
.tabbar a.on { color: var(--ink); background: var(--sun); border: 2px solid var(--ink); }

/* ---------- learn ---------- */
.nudge { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; background: #FFF0E0; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--sh-sm); font-weight: 700; font-size: 15px; animation: wiggle 2.4s ease-in-out infinite; }
.nudge > .ic { color: #F2711C; width: 28px; height: 28px; }
.nudge p { flex: 1; }
.hello { display: flex; align-items: center; gap: 14px; background: linear-gradient(160deg, #fff 55%, var(--lime-2)); }
.hello-copy { flex: 1; display: grid; gap: 6px; }
.hello h1 { font-size: 24px; }
.cta { display: flex; align-items: center; gap: 14px; margin-top: 14px; text-decoration: none; background: var(--sky-2); transition: transform .08s, box-shadow .08s; }
.cta:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.cta-emo { display: grid; place-items: center; width: 58px; height: 58px; flex: none; font-size: 30px; border: var(--bw) solid var(--ink); border-radius: 16px; background: var(--sun); }
.cta-copy { flex: 1; display: grid; }
.cta-copy b { font-size: 20px; }
.cta-copy small { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.cta-go { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--coral); color: #fff; border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm); }
[dir="rtl"] .cta-go .ic, [dir="rtl"] .node.cur .node-btn .ic, [dir="rtl"] .btn .ic-play { transform: scaleX(-1); }
.bite { margin-top: 14px; display: grid; gap: 10px; background: #fff; }
.bite-head { display: flex; justify-content: space-between; align-items: center; }
.ok-line { color: #2E8B3A; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.bite .btn { justify-self: start; }

.world { margin-bottom: 26px; }
.world-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); background: var(--wc); }
.world-head h2 { font-size: 20px; } .world-head p { font-size: 14px; color: var(--ink-2); }
.world-head > div { flex: 1; }
.world-emo { font-size: 30px; }
.world-count { font-weight: 800; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.w-sun { --wc: var(--sun); --wc2: var(--sun-2); } .w-sky { --wc: var(--sky); --wc2: var(--sky-2); }
.w-lime { --wc: var(--lime); --wc2: var(--lime-2); } .w-grape { --wc: var(--grape); --wc2: var(--grape-2); }
.w-coral { --wc: #FF8A7D; --wc2: var(--coral-2); } .w-teal { --wc: var(--teal); --wc2: var(--teal-2); }
.bar-coral > i { background: var(--coral); } .bar-teal > i { background: var(--teal); }
.w-pink { --wc: var(--pink); --wc2: #FFE0E7; } .bar-pink > i { background: var(--pink); }

/* Language showcase (landing) */
.lp-langs { display: grid; gap: 10px; margin-bottom: 44px; text-align: center; }
.lp-langs h2 { font-size: 30px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; text-align: start; }
.lang-card { display: grid; gap: 8px; align-content: start; padding: 18px; text-decoration: none; background: #fff; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); transition: transform .08s, box-shadow .08s; }
.lang-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.lang-emo { display: grid; place-items: center; width: 56px; height: 56px; font-size: 30px; border: 2px solid var(--ink); border-radius: 16px; background: var(--wc); }
.lang-card h3 { font-size: 24px; }
.lang-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; font-weight: 600; }
.lang-card li { display: flex; gap: 6px; align-items: flex-start; }
.lang-card li .ic, .outcomes .ic { color: #2E8B3A; margin-top: 3px; }
.lang-meta { font-size: 13px; font-weight: 800; color: var(--muted); }
.lang-go { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #C2372A; }
.flip-r { transform: scaleX(-1); } [dir="rtl"] .flip-r { transform: none; }
.also { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 8px; font-size: 15px; }
.also-chip { padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--wc2); font-weight: 700; text-decoration: none; }

/* Language choice (onboarding) */
.lang-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lang-pick label { position: relative; cursor: pointer; }
.lang-pick label:last-child { grid-column: 1 / -1; }
.lang-pick input { position: absolute; opacity: 0; }
.lang-pick span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border: var(--bw) solid var(--ink); border-radius: 14px; background: #fff; box-shadow: var(--sh-sm); }
.lang-pick i { grid-row: span 2; font-style: normal; font-size: 26px; }
.lang-pick b { font-size: 16px; line-height: 1.2; }
.lang-pick small { font-size: 12px; color: var(--muted); font-weight: 700; }
.lang-pick input:checked + span { background: var(--wc, var(--sun)); }
.lang-pick .w-all { --wc: var(--sun); }
.lang-pick input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Course overview */
.course { display: grid; gap: 14px; padding-bottom: 10px; }
.lp .course { max-width: 560px; margin: 0 auto; }
.course-hero { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 22px 18px; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); background: linear-gradient(180deg, var(--wc2), #fff 75%); }
.course-hero h1 { font-size: 34px; }
.course-hero .lead { font-size: 17px; }
.course-hero .bar { width: 100%; }
.course-emo { display: grid; place-items: center; width: 84px; height: 84px; font-size: 46px; border: var(--bw) solid var(--ink); border-radius: 24px; background: var(--wc); box-shadow: var(--sh-sm); }
.course-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.course-stats span { display: grid; justify-items: center; padding: 8px 4px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.course-stats b { font-size: 22px; color: var(--ink); line-height: 1.1; }
.outcomes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.outcomes li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.outline { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ol-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid rgba(29,27,47,.15); border-radius: 14px; background: #fff; text-decoration: none; }
a.ol-row { border-color: var(--ink); box-shadow: var(--sh-sm); }
.ol-row.cur { background: var(--wc2); }
.ol-n { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 800; background: var(--paper); }
.ol-row.done .ol-n { background: var(--lime); }
.ol-t { flex: 1; display: grid; min-width: 0; }
.ol-t small { color: var(--muted); font-weight: 600; font-size: 13px; }
.ol-s { color: #E0A800; font-weight: 800; letter-spacing: 1px; }
.ol-row.cur .ol-s { color: var(--coral); }
a.world-head { text-decoration: none; color: inherit; }
.world-head u { text-underline-offset: 2px; font-weight: 700; }

/* Languages picker */
.tracks { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 18px; padding: 4px 16px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.tracks::-webkit-scrollbar { display: none; }
.track { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; box-shadow: var(--sh-sm); font-weight: 800; font-size: 15px; cursor: pointer; scroll-snap-align: start; white-space: nowrap; }
.track small { font-size: 12px; font-weight: 700; color: var(--muted); }
.track.on { background: var(--ink); color: #fff; }
.track.on small { color: rgba(255,255,255,.75); }
.track:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.cta-emo[class*="w-"] { background: var(--wc); }
.path { list-style: none; margin: 0; padding: 18px 0 0; display: grid; gap: 22px; justify-items: center; }
.node { position: relative; display: grid; justify-items: center; gap: 6px; transform: translateX(calc(var(--x) * 64px)); }
.node-btn { display: grid; place-items: center; width: 76px; height: 70px; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--wc); box-shadow: 0 6px 0 var(--ink); text-decoration: none; transition: transform .08s, box-shadow .08s; }
.node-btn .ic { width: 32px; height: 32px; }
.node-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.node.done .node-btn { color: #fff; } .node.done .node-btn .ic { color: #fff; filter: drop-shadow(0 2px 0 var(--ink)); }
.node.cur .node-btn { background: var(--coral); color: #fff; animation: pulse 1.8s ease-in-out infinite; }
.node.locked .node-btn { background: #E9E4D8; color: #A29D8C; border-color: #BDB6A4; box-shadow: 0 6px 0 #BDB6A4; cursor: not-allowed; }
.node-label { font-weight: 800; font-size: 14px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 1px 10px; text-align: center; display: grid; }
.node.locked .node-label { color: var(--muted); border-color: #BDB6A4; }
.mini-stars { color: #E0A800; font-size: 12px; letter-spacing: 2px; }
.node-meeko { position: absolute; top: -6px; inset-inline-end: calc(100% + 4px); }

/* ---------- quests / streak ---------- */
.quest { display: flex; align-items: center; gap: 12px; padding: 14px; }
.quest-ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; background: var(--sun-2); border: 2px solid var(--ink); border-radius: 12px; }
.quest-ic .ic { width: 26px; height: 26px; color: #E0822A; }
.quest-body { flex: 1; display: grid; gap: 6px; }
.quest-body .bar { height: 18px; }
.quest.claimed { background: var(--lime-2); }
.done-tag { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--lime); border: 2px solid var(--ink); }
.chest { margin-top: 12px; display: flex; align-items: center; gap: 12px; background: repeating-linear-gradient(-45deg, #fff, #fff 12px, #FFF8E4 12px, #FFF8E4 24px); }
.chest > div:nth-child(2) { flex: 1; }
.chest-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--sun); border: 2px solid var(--ink); }
.chest-ic .ic { width: 32px; height: 32px; }
.chest.ready .chest-ic { animation: wiggle 1.2s ease-in-out infinite; }
.streak-card { display: grid; gap: 14px; justify-items: center; text-align: center; background: linear-gradient(180deg, #FFF0E0, #fff 60%); }
.streak-big { display: grid; justify-items: center; }
.streak-big .ic { width: 64px; height: 64px; color: #F2711C; filter: drop-shadow(0 3px 0 var(--ink)); }
.streak-big b { font-size: 44px; line-height: 1; }
.streak-big span { font-weight: 700; color: var(--ink-2); }
.week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; }
.week li { display: grid; justify-items: center; gap: 4px; padding: 8px 0; border-radius: 12px; border: 2px solid transparent; font-weight: 800; font-size: 13px; color: var(--muted); }
.week li .ic { width: 24px; height: 24px; color: #DDD6C4; }
.week li.lit .ic { color: #F2711C; }
.week li.today { border-color: var(--ink); background: #fff; color: var(--ink); }
.ic-sky { color: #3A92D1; }

/* ---------- league ---------- */
.league-head { display: flex; align-items: center; gap: 14px; padding: 18px; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 16px; }
.league-head h1 { font-size: 26px; } .league-head p { font-weight: 600; color: var(--ink-2); }
.tier-badge { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; border: var(--bw) solid var(--ink); background: #fff; box-shadow: var(--sh-sm); }
.tier-badge .ic { width: 36px; height: 36px; }
.tier-bronze { background: #F4C8A0; } .tier-silver { background: #E2E6EE; } .tier-gold { background: var(--sun); } .tier-emerald { background: var(--lime); } .tier-diamond { background: var(--sky); }
.board { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.board .row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; }
.board .row.me { background: var(--sun-2); border: 2px solid var(--ink); }
.rank { width: 30px; text-align: center; font-weight: 800; font-size: 18px; }
.av { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); overflow: hidden; }
.nm { flex: 1; font-weight: 700; } .nm small { color: var(--muted); }
.xp { font-weight: 800; font-size: 15px; }
.zone { text-align: center; font-size: 12px; font-weight: 800; color: #2E8B3A; border-top: 2px dashed #7ED957; padding-top: 4px; margin: 4px 0; }

/* ---------- progress ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.stat { display: grid; justify-items: start; gap: 2px; padding: 14px; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--sh-sm); background: var(--sc, #fff); }
.stat .ic { width: 22px; height: 22px; }
.stat b { font-size: 26px; line-height: 1.1; }
.stat span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.s-sun { --sc: var(--sun-2); } .s-lime { --sc: var(--lime-2); } .s-sky { --sc: var(--sky-2); } .s-coral { --sc: var(--coral-2); }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 19px; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 170px; align-items: end; margin-top: 14px; }
.chart .col { position: relative; display: grid; grid-template-rows: auto 1fr auto; height: 100%; justify-items: center; align-items: end; gap: 4px; }
.chart i { display: block; width: 100%; max-width: 34px; background: var(--sky); border: 2px solid var(--ink); border-radius: 8px 8px 4px 4px; align-self: end; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.chart .today i { background: var(--coral); }
.chart .v { font-size: 11px; font-weight: 800; }
.chart .d { font-size: 12px; font-weight: 700; color: var(--muted); }
.skill { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 10px; margin-top: 12px; font-weight: 700; font-size: 15px; }
.insight { margin-top: 14px; padding: 10px 12px; background: var(--sun-2); border-radius: 12px; font-weight: 600; font-size: 15px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 12px 6px; border: 2px dashed #BDB6A4; border-radius: var(--r-sm); background: rgba(255,255,255,.5); color: var(--muted); }
.badge b { font-size: 13px; line-height: 1.2; } .badge small { font-size: 11px; line-height: 1.2; }
.badge-ic { display: grid; place-items: center; width: 48px; height: 48px; font-size: 26px; border-radius: 50%; background: #EEE9DC; }
.badge.has { border: var(--bw) solid var(--ink); background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }
.badge.has .badge-ic { background: var(--sun); border: 2px solid var(--ink); }
.parent { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-top: 20px; background: var(--grape-2); }

/* ---------- me ---------- */
.profile { display: grid; justify-items: center; text-align: center; gap: 4px; background: radial-gradient(circle at 50% 35%, var(--sun-2) 0 38%, #fff 39%); }
.profile h1 { font-size: 26px; }
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; background: #fff; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--sh-sm); cursor: pointer; }
.shop-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.shop-item b { font-size: 13px; }
.shop-item .price { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 800; color: #3A92D1; }
.shop-item.wearing { background: var(--lime-2); }
.shop-item.wearing .price { color: #2E8B3A; }
.settings { display: grid; gap: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 2px dashed rgba(29,27,47,.12); font-weight: 700; }
.set-row:last-of-type { border-bottom: 0; }
.set-row b { font-size: 14px; text-align: end; }
.input-time { flex: 0 0 auto; width: auto; padding: 6px 10px; font-size: 16px; }
.switch { position: relative; display: inline-block; width: 56px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #E9E4D8; border: 2px solid var(--ink); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: inset-inline-start .2s; }
.switch input:checked + i { background: var(--lime); }
.switch input:checked + i::after { inset-inline-start: 27px; }
.switch input:focus-visible + i { outline: 3px solid var(--sky); outline-offset: 2px; }
.stack-row { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }

/* ---------- lesson ---------- */
.lesson { min-height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--wc2) 0, var(--paper) 220px); }
.lesson-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.bar-lesson { flex: 1; height: 18px; }
.bar-lesson > i { background: var(--lime); }
.combo { min-width: 50px; font-weight: 800; color: #F2711C; display: inline-flex; align-items: center; gap: 2px; }
.stage { flex: 1; padding: 10px 18px 20px; display: grid; align-content: start; gap: 16px; }
.stage.pop { animation: popin .35s cubic-bezier(.2,.9,.3,1.3); }
.q { font-size: 23px; }
.learn-card { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 22px; }
.learn-text { font-size: 20px; line-height: 1.5; }
.learn-text b { background: linear-gradient(transparent 55%, var(--sun) 55%); padding: 0 2px; }
.code { margin: 0; padding: 14px 16px; background: #1D1B2F; color: #F4F1FF; border-radius: 16px; border: var(--bw) solid var(--ink); box-shadow: var(--sh); font-size: 16px; line-height: 1.6; overflow-x: auto; text-align: left; white-space: pre; }
.learn-card .code { width: 100%; }
.code .s { color: #B8F28F; } .code .k { color: #FF9EC4; font-weight: 700; } .code .n { color: #FFD66B; } .code .c { color: #8C88A8; font-style: italic; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; text-align: start; background: #fff; border: var(--bw) solid var(--ink); border-radius: 16px; box-shadow: var(--sh); font-size: 18px; font-weight: 700; cursor: pointer; transition: transform .08s, box-shadow .08s, background .15s; }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.opt code { font-size: 17px; }
.opt-k { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--ink); font-size: 14px; font-weight: 800; background: var(--paper); }
.opt.sel { background: var(--sky-2); } .opt.sel .opt-k { background: var(--sky); }
.opt.right { background: var(--lime-2); } .opt.right .opt-k { background: var(--lime); }
.opt.wrong { background: var(--coral-2); } .opt.wrong .opt-k { background: var(--coral); color: #fff; }
.opt:disabled { cursor: default; }
.slot { display: inline-block; min-width: 3.2ch; padding: 0 6px; border-bottom: 3px dashed var(--sun); color: var(--sun); text-align: center; }
.slot.filled { background: var(--sun); color: var(--ink); border-radius: 6px; border-bottom: 0; animation: popin .25s; }
.chips-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tok { min-width: 70px; min-height: 52px; padding: 8px 16px; font: 700 18px var(--mono); background: #fff; border: var(--bw) solid var(--ink); border-radius: 14px; box-shadow: var(--sh); cursor: pointer; }
.tok.sel { background: var(--sun); }
.tok.right { background: var(--lime); } .tok.wrong { background: var(--coral); color: #fff; }
.answer-area { list-style: none; margin: 0; padding: 10px; min-height: 120px; display: grid; gap: 8px; align-content: start; border: var(--bw) dashed var(--ink); border-radius: 16px; background: rgba(255,255,255,.6); counter-reset: ln; }
.answer-area li { counter-increment: ln; display: flex; align-items: center; gap: 8px; }
.answer-area li:not(.ph)::before { content: counter(ln); font-weight: 800; color: var(--muted); width: 18px; text-align: center; }
.answer-area .ph { color: var(--muted); font-weight: 600; justify-content: center; padding: 30px 0; }
.pool { display: grid; gap: 8px; }
.line { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 8px 14px; text-align: start; background: #fff; border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm); font-size: 16px; font-weight: 700; cursor: pointer; white-space: pre; }
.line code { white-space: pre; }
.answer-area .line { background: var(--sky-2); }
.line.ghost { opacity: .35; box-shadow: none; border-style: dashed; cursor: default; }
.maze { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; padding: 8px; background: #CBEFB4; border: var(--bw) solid var(--ink); border-radius: 18px; box-shadow: var(--sh); }
.cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.55); font-size: 28px; }
.cell.rock { background: #A99F8A; }
.cell.trod { background: var(--sun-2); }
.cell .meeko { width: 90%; height: 90%; }
.bug { animation: bob 1.6s ease-in-out infinite; }
.prog { display: flex; flex-wrap: wrap; gap: 6px; min-height: 58px; padding: 8px; border: var(--bw) dashed var(--ink); border-radius: 14px; background: rgba(255,255,255,.7); align-items: center; }
.prog .ph { color: var(--muted); font-weight: 600; font-size: 14px; margin: auto; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.blk { display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; min-width: 56px; height: 52px; padding: 0 12px; font-size: 26px; font-weight: 800; background: var(--grape-2); border: var(--bw) solid var(--ink); border-radius: 14px; box-shadow: var(--sh-sm); cursor: pointer; }
.blk small { font-size: 15px; }
.blk.sm { min-width: 42px; height: 40px; font-size: 20px; background: var(--grape); color: #fff; }
.blk:disabled { opacity: .6; }
.lfoot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px max(16px, env(safe-area-inset-bottom)); background: var(--paper); border-top: var(--bw) solid var(--ink); }
.lfoot.ok { background: var(--lime-2); } .lfoot.bad { background: var(--coral-2); }
.lfoot.ok, .lfoot.bad { animation: slideup .25s ease-out; }
.fb { display: flex; gap: 12px; width: 100%; align-items: flex-start; }
.fb b { font-size: 20px; }
.fb p { font-size: 15px; font-weight: 600; }
.fb-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.ok .fb-ic { color: #2E8B3A; } .bad .fb-ic { color: #C2372A; }

/* ---------- lesson complete ---------- */
.done-screen { flex: 1; display: grid; justify-items: center; align-content: center; gap: 14px; padding: 30px 20px; text-align: center; }
.done-screen h1 { font-size: 32px; }
.done-meeko { position: relative; }
.done-meeko::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; background: var(--sun); border: var(--bw) solid var(--ink); z-index: -1; }
.big-stars { display: flex; gap: 6px; }
.big-stars span { color: #DDD6C4; }
.big-stars .ic { width: 52px; height: 52px; }
.big-stars span.on { color: var(--sun); filter: drop-shadow(0 3px 0 var(--ink)); animation: starpop .5s cubic-bezier(.2,.9,.3,1.5) both; }
.done-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.done-stats .stat { justify-items: center; }
.wins { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-weight: 700; }
.wins li { display: flex; align-items: center; gap: 6px; justify-content: center; }
.wins .ic { color: #F2711C; }
.done-screen .btn { max-width: 420px; }
.badge-pop { font-size: 64px; width: 110px; height: 110px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: var(--sun); border: var(--bw) solid var(--ink); box-shadow: var(--sh); animation: starpop .6s cubic-bezier(.2,.9,.3,1.5); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; justify-items: center; background: rgba(29,27,47,.45); opacity: 0; transition: opacity .2s; }
.overlay.in { opacity: 1; }
.sheet { width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto; display: grid; gap: 14px; padding: 22px 20px max(22px, env(safe-area-inset-bottom)); background: var(--paper); border: var(--bw) solid var(--ink); border-bottom: 0; border-radius: 26px 26px 0 0; transform: translateY(40px); transition: transform .3s cubic-bezier(.2,.9,.3,1.2); }
.overlay.in .sheet { transform: none; }
.sheet h2 { font-size: 24px; }
.sheet .center { display: grid; gap: 12px; justify-items: center; }
.toast { position: fixed; z-index: 200; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 10px 18px; background: var(--ink); color: #fff; border-radius: 999px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.25); animation: dropin .3s cubic-bezier(.2,.9,.3,1.3); max-width: calc(100vw - 32px); }
.toast.out { opacity: 0; transition: opacity .3s; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }

/* ---------- desktop side buddies ---------- */
.buddy-zone { position: fixed; top: 0; bottom: 0; z-index: 15; pointer-events: none; }
.buddy-zone[data-side="left"] { left: 12px; }
.buddy-zone[data-side="right"] { right: 12px; }
.buddy-zone[hidden] { display: none; }
.buddy { position: absolute; bottom: 36px; left: 0; display: grid; justify-items: center; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; transition: left 1s linear; }
.buddy:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 20px; }
.bud-svg { display: block; transition: transform .3s; }
.bud-svg.face-left { transform: scaleX(-1); }
.bud-svg .pupil { transition: transform .12s ease-out; transform-box: fill-box; transform-origin: center; }
.bud-shadow { width: 70px; height: 10px; margin-top: -8px; border-radius: 50%; background: rgba(29,27,47,.15); }
.bud-say { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 190px; padding: 8px 12px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--sh-sm); font: 700 14px/1.3 var(--font); color: var(--ink); text-align: center; animation: popin .25s; }
.bud-say::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--ink); }
.bud-say.code { font: 700 13px/1.3 var(--mono); background: var(--ink); color: #B8F28F; direction: ltr; white-space: nowrap; max-width: none; }
.bud-say[hidden] { display: none; }
.buddy.walking .bud-svg { animation: waddle .35s ease-in-out infinite alternate; }
.buddy.jump { animation: hop .6s cubic-bezier(.3,1.6,.5,1); }
.buddy.wiggle .bud-svg { animation: wiggle 1s ease-in-out; }
.buddy.shake { animation: shake .4s; }
.buddy.typing .bud-svg { animation: tap .18s ease-in-out infinite alternate; }
.buddy.typist::before { content: '💻'; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 34px; z-index: 1; }
.buddy.sleeping .bud-svg { filter: saturate(.7); }
.buddy.sleeping .pupil { transform: scaleY(.15) !important; }
.buddy.sleeping::after { content: 'z Z z'; position: absolute; top: -10px; right: -6px; font: 800 18px var(--font); color: var(--muted); animation: drift 2.4s ease-in-out infinite; }
.bug-btn { position: absolute; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; background: none; font-size: 28px; cursor: pointer; pointer-events: auto; transform: rotate(var(--r, 0deg)); transition: left 2s ease-in-out, top 2s ease-in-out, transform .4s; animation: popin .3s; }
.bug-btn:hover { transform: rotate(var(--r, 0deg)) scale(1.2); }
.bug-btn.squash { transform: scale(1.6); opacity: 0; transition: transform .4s, opacity .4s; }
.bug-btn.leave { opacity: 0; transition: opacity .6s; }
.bug-count { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 800; font-size: 13px; pointer-events: none; }
.bug-count[hidden] { display: none; }
@keyframes waddle { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-3px); } }
@keyframes hop { 40% { transform: translateY(-34px); } }
@keyframes tap { to { transform: translateY(2px); } }
body.calm .buddy.walking .bud-svg, body.calm .buddy.typing .bud-svg { animation: none; }
.lp:has(.site-foot) { padding-bottom: 0; }

/* ---------- motion ---------- */
.bob { animation: bob 3s ease-in-out infinite; }
.bounce { animation: bounce 1s cubic-bezier(.3,1.6,.5,1) both; }
.shake { animation: shake .4s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes bounce { 0% { transform: scale(.4) translateY(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.07); } }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-3deg); } 90% { transform: rotate(3deg); } 95% { transform: rotate(-2deg); } }
@keyframes popin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes slideup { from { transform: translateY(20px); opacity: .5; } }
@keyframes dropin { from { transform: translate(-50%, -20px); opacity: 0; } }
@keyframes starpop { from { transform: scale(0) rotate(-30deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes drift { 50% { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}
