:root {
  --paper: #fff4e2;
  --paper2: #ffe9c9;
  --ink: #141414;
  --white: #fff;
  --red: #e8202e;
  --yel: #ffc531;
  --sky: #7cc6ff;
  --mint: #7ee0b5;
  --muted: #6d6458;
  --bw: 2.5px;
  --sh: 4px 4px 0 var(--ink);
  --r: 20px;
  --head: "Rubik", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 600 15px/1.5 var(--body); }
body { overscroll-behavior: none;
  background-image: radial-gradient(#00000012 1px, transparent 1.4px); background-size: 18px 18px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; line-height: 1.08; letter-spacing: -.01em; }
p { margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
mark { background: linear-gradient(transparent 55%, var(--yel) 55%); color: inherit; padding: 0 2px; }
.tag { display: inline-block; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; background: var(--yel);
  border: 2px solid var(--ink); border-radius: 999px; padding: 6px 10px; }
.tag.dark { background: var(--ink); color: var(--paper); }
.sticker { background: var(--white); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border: var(--bw) solid var(--ink);
  border-radius: 14px; box-shadow: var(--sh); font: 800 15px var(--body); background: var(--white); transition: transform .12s, box-shadow .12s; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.red { background: var(--red); color: #fff; }
.btn.yel { background: var(--yel); }
.btn.wide { width: 100%; height: 54px; font-size: 16px; }

/* header */
.top { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px;
  background: var(--paper); }
.logo { display: flex; align-items: center; gap: 8px; font: 900 16px var(--head); text-transform: uppercase; letter-spacing: .02em; }
.logo img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); }
.me { width: 40px; height: 40px; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--yel) center/cover; box-shadow: 2px 2px 0 var(--ink); }

.seg { position: sticky; top: 60px; z-index: 4; margin: 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white);
  border: var(--bw) solid var(--ink); border-radius: 16px; padding: 4px; box-shadow: var(--sh); }
.seg button { position: relative; z-index: 1; height: 38px; font: 800 14px var(--body); border-radius: 11px; transition: color .25s; }
.seg button.on { color: #fff; }
.seg-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); background: var(--ink); border-radius: 11px;
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }

#app { max-width: 560px; margin: 0 auto; padding: 18px 16px 0; }
.tab { display: none; }
.tab.on { display: block; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.spacer { height: calc(120px + var(--safe-b)); }
.sec { font-size: 22px; margin: 30px 0 14px; }
.sec.first { margin-top: 6px; }

/* poster */
.poster { position: relative; border: var(--bw) solid var(--ink); border-radius: 26px; box-shadow: 6px 6px 0 var(--ink); background: var(--yel);
  overflow: hidden; padding: 20px 18px 0; }
.poster::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, #ffffff22 0 14px, transparent 14px 28px); }
.poster-txt { position: relative; z-index: 1; }
.poster h1 { font-size: 34px; font-weight: 900; margin-top: 12px; }
.poster mark { background: linear-gradient(transparent 55%, #fff 55%); }
.poster-img { position: relative; width: 78%; margin: 6px auto 0; border-radius: 18px 18px 0 0; border: var(--bw) solid var(--ink); border-bottom: 0;
  aspect-ratio: 3/3.4; object-fit: cover; object-position: 50% 20%; }
.progress { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0 -18px; padding: 12px 18px;
  background: var(--ink); color: var(--paper); font: 500 12px var(--mono); }
.pbar { flex: 1; height: 10px; border-radius: 99px; background: #ffffff22; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: var(--yel); transition: width .6s cubic-bezier(.3, 1.4, .5, 1); }

/* before / after */
.motor { margin-top: 20px; padding: 14px; }
.motor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
.ba { --w: 300px; position: relative; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; max-height: 62vh; margin: 0 auto;
  background: #ddd; touch-action: pan-y; user-select: none; }
.ba img { position: absolute; top: 0; left: calc(var(--w) * -1); width: calc(var(--w) * 2); max-width: none; height: 100%; object-fit: cover; pointer-events: none; }
.ba-cover { position: absolute; inset: 0 auto 0 0; width: 50%; overflow: hidden; border-right: 3px solid var(--ink); }
.ba-cover img { left: 0; }
.ba.noimg { background: linear-gradient(90deg, #bbb 50%, var(--yel) 50%); }
.ba-handle { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--yel);
  border: var(--bw) solid var(--ink); display: grid; place-items: center; font-weight: 900; box-shadow: 2px 2px 0 var(--ink); }

/* path */
.path { position: relative; padding: 4px 0 10px; }
.path svg.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.node { position: relative; display: flex; align-items: center; gap: 14px; width: 82%; margin: 0 0 26px; text-align: left; }
.node:nth-child(even of .node) { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.disc { position: relative; flex: none; width: 92px; height: 92px; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--white) center/cover;
  box-shadow: var(--sh); transition: transform .2s; }
.node:active .disc { transform: scale(.94); }
.disc .n { position: absolute; left: -6px; top: -6px; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; border: 2px solid var(--ink);
  display: grid; place-items: center; font: 900 14px var(--head); }
.disc .ok { position: absolute; right: -6px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink);
  display: none; place-items: center; font-weight: 900; }
.node.done .disc .ok { display: grid; }
.node h4 { font-size: 17px; }
.node p { margin: 3px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.node.locked .disc { filter: grayscale(1) contrast(.9); opacity: .7; }
.node.locked .disc .n { background: #9b9286; }
.node.locked .disc::after { content: "🔒"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; background: #fff4e299; border-radius: 50%; }
.node.next .disc { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
.gate { position: relative; margin: 6px 0 30px; padding: 16px; border: var(--bw) dashed var(--ink); border-radius: var(--r); background: var(--paper2); text-align: center; }
.gate h3 { font-size: 19px; }
.gate .btn { margin-top: 12px; }

/* prompts */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 14px; padding: 2px 16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); font-weight: 800; font-size: 13px; }
.chip.on { background: var(--ink); color: var(--paper); }
.pcard { padding: 14px; margin-bottom: 14px; }
.pcard h4 { font-size: 16px; margin-bottom: 8px; }
.pcard .lbl { font: 500 11px var(--mono); text-transform: uppercase; color: var(--red); letter-spacing: .06em; }
.pcard.locked pre { filter: blur(4px); user-select: none; max-height: 90px; overflow: hidden; }
.pcard.locked { position: relative; }
.pcard.locked .lockbar { position: absolute; left: 14px; right: 14px; bottom: 14px; }
pre { position: relative; white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px;
  padding: 12px 12px 44px; font: 500 12.5px/1.5 var(--mono); }
.copy { position: absolute; right: 8px; bottom: 8px; height: 30px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 9px; background: var(--yel); font-weight: 800; font-size: 12px; }

/* ticket */
.ticket { display: grid; grid-template-columns: 1fr 18px 112px; border: var(--bw) solid var(--ink); border-radius: 22px; background: var(--red); color: #fff;
  box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.t-main { padding: 18px 8px 18px 18px; }
.t-main .tag { color: var(--ink); }
.t-main h2 { font-size: 24px; margin-top: 12px; font-weight: 900; }
.t-main p { font-size: 13.5px; opacity: .95; }
.t-perf { background: radial-gradient(circle at 50% 0, var(--paper) 9px, transparent 10px) top/18px 22px repeat-y,
  radial-gradient(circle at 50% 100%, var(--paper) 9px, transparent 10px) bottom/18px 22px repeat-y; border-left: 3px dashed #ffffffaa; margin: 0 0 0 8px; }
.t-stub { background: var(--yel); color: var(--ink); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 12px 8px; text-align: center; }
.t-price { font: 900 30px var(--head); writing-mode: horizontal-tb; }
.program { list-style: none; counter-reset: s 3; padding: 0; margin: 0; }
.program li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 2px dashed #14141433; }
.program li::before { content: counter(s); width: 40px; height: 40px; border-radius: 12px; background: var(--white); border: 2px solid var(--ink); display: grid; place-items: center; font: 900 16px var(--head); }
.program b { display: block; font-size: 15.5px; }
.program span { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kit { padding: 14px; }
.kit b { display: block; font: 900 26px var(--head); }
.kit span { font-size: 13px; }
.needs { padding: 0; list-style: none; margin: 0; }
.needs li { padding: 10px 12px 10px 40px; position: relative; margin-bottom: 8px; background: var(--white); border: 2px solid var(--ink); border-radius: 14px; }
.needs li::before { content: "✓"; position: absolute; left: 12px; top: 9px; font-weight: 900; color: var(--red); }
.faq-item { background: var(--white); border: 2px solid var(--ink); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.faq-item button { width: 100%; text-align: left; padding: 13px 14px; font-weight: 800; display: flex; justify-content: space-between; gap: 10px; }
.faq-item div { display: none; padding: 0 14px 14px; color: #3b352e; }
.faq-item.open div { display: block; }
.faq-item.open button span { transform: rotate(45deg); }
.faq-item button span { transition: transform .2s; font-size: 20px; line-height: 1; }

/* sheet */
.veil { position: fixed; inset: 0; background: #14141466; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 8; }
.veil.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; max-height: 88vh; overflow-y: auto; background: var(--paper);
  border-top: var(--bw) solid var(--ink); border-radius: 26px 26px 0 0; transform: translateY(105%); transition: transform .35s cubic-bezier(.2, 1, .3, 1);
  padding: 8px 18px calc(110px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.sheet.on { transform: none; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: #14141455; margin: 4px auto 14px; }
.sheet-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border: var(--bw) solid var(--ink); border-radius: 18px; box-shadow: var(--sh); background: var(--white); }
.sheet h2 { font-size: 24px; margin: 16px 0 4px; }
.sheet .body p, .sheet .body li { font-size: 15px; }
.sheet .body h3, .sheet .body h4 { margin: 16px 0 6px; font-size: 17px; }
.sheet .body { overflow-x: auto; }
.sheet table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; background: var(--white); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.sheet th, .sheet td { border-bottom: 1.5px solid #14141422; padding: 8px 10px; text-align: left; vertical-align: top; min-width: 90px; }
.sheet th { background: var(--yel); font-weight: 800; }
.sheet ul, .sheet ol { padding-left: 20px; }
.sheet code { font: 500 12.5px var(--mono); background: var(--paper2); padding: 1px 5px; border-radius: 5px; }
.next { margin-top: 18px; padding: 14px; border: var(--bw) solid var(--ink); border-radius: 16px; background: var(--yel); box-shadow: var(--sh); }
.next b { display: block; font-family: var(--head); font-size: 16px; margin-bottom: 4px; }
.row { display: block; width: 100%; text-align: left; margin-bottom: 10px; padding: 14px 16px; }
.row b { display: block; font-size: 16px; }
.row span { font-size: 13px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.who .me { width: 58px; height: 58px; }

.web-cta { display: none; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--paper) 40%); z-index: 7; }
body.no-tg .web-cta { display: block; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); font-weight: 800; padding: 10px 16px;
  border-radius: 12px; opacity: 0; transition: .3s; z-index: 20; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; z-index: 30; width: 10px; height: 14px; pointer-events: none; animation: fall 1.1s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 70vh) rotate(540deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 360px) { .poster h1 { font-size: 29px; } .ticket { grid-template-columns: 1fr 14px 96px; } }
