/* Scoped invitation and guided profile focus. No existing profile layout changes. */
:root{--tg-guide-safe-top:env(safe-area-inset-top,0px);--tg-guide-safe-bottom:env(safe-area-inset-bottom,0px)}
.tg-guide-invite{padding:0;width:min(480px,calc(100vw - 28px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid #73529b;border-radius:22px;background:#191323;color:#f4effb;box-shadow:0 0 48px 20px #0a051a70,0 28px 90px #0009;font-family:inherit;opacity:0;transform:translateY(14px) scale(.96);transition:opacity .45s ease,transform .6s cubic-bezier(.16,1,.3,1)}
.tg-guide-invite[open].tg-entered{opacity:1;transform:translateY(0) scale(1)}
.tg-guide-invite[open].tg-leaving{opacity:0;transform:translateY(8px) scale(.98);pointer-events:none}
.tg-guide-invite::backdrop{background:radial-gradient(ellipse at 50% 48%,#10081ce0 0%,#0d0718ca 35%,#09061390 72%,#09061366 100%);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:tg-guide-backdrop .6s ease both}
.tg-guide-invite.tg-leaving::backdrop{animation:tg-guide-backdrop-out .45s ease both}
body.tg-invite-active{overflow:hidden}
body.tg-invite-active .app-shell{filter:blur(4px) saturate(.78);transform:scale(1.012);transform-origin:50% 40%;transition:filter .6s ease,transform .7s cubic-bezier(.2,.7,.2,1)}
body.tg-invite-return .app-shell{transition:filter .6s ease,transform .7s cubic-bezier(.2,.7,.2,1)}
.tg-guide-art{display:block;width:100%;height:auto;aspect-ratio:2.2;object-fit:cover;background:#150e2b;border-bottom:1px solid #684480}
.tg-guide-copy{padding:23px}
.tg-guide-copy h2{margin:0 0 12px;font-size:clamp(1.15rem,4vw,1.45rem);line-height:1.3;font-weight:800;color:#f4effb}
.tg-guide-copy p{margin:0 0 21px;font-size:.92rem;line-height:1.65;color:#d1c5df}
.tg-guide-main,.tg-guide-small{font:inherit;border-radius:12px;cursor:pointer;touch-action:manipulation}
.tg-guide-main{display:block;width:100%;border:1px solid #b18be6;background:linear-gradient(115deg,#9d6ce4,#7451c7);color:#fff;padding:13px 16px;min-height:46px;font-weight:750;font-size:.9rem;transition:filter .2s,transform .2s}
.tg-guide-main:hover{filter:brightness(1.12)}
.tg-guide-main:active{transform:scale(.985)}
.tg-guide-small{border:0;background:transparent;color:#bfb0d1;padding:10px 5px;min-height:42px;font-size:.79rem}
.tg-guide-small:hover{color:#f3eaff}
.tg-guide-links{display:flex;justify-content:space-between;gap:10px;margin-top:9px}
.tg-guide-main:focus-visible,.tg-guide-small:focus-visible{outline:2px solid #75e2da;outline-offset:3px}
.tg-guide-root{position:fixed;inset:0;z-index:2147483000;pointer-events:none;color:#f4effb;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;font-weight:600;line-height:1.55;opacity:1;transition:opacity .25s ease}
.tg-guide-root.tg-guide-initial{visibility:hidden;opacity:0}
.tg-guide-root.tg-guide-paused{visibility:hidden}
.tg-guide-root.tg-guide-ending{opacity:0}
.tg-guide-shade{position:fixed;inset:0;background:#080612bb;pointer-events:none}
.tg-guide-hole{position:fixed;box-sizing:border-box;border:1.5px solid #8ce8e2;border-radius:15px;box-shadow:0 0 0 3px #80dcd022,0 0 20px #b887ff40;transform-origin:0 0;transition:opacity .22s ease;pointer-events:none}
.tg-guide-travel .tg-guide-hole{opacity:0}
.tg-guide-travel .tg-guide-shade{clip-path:none!important}
.tg-guide-land{animation:tg-guide-land .65s ease both}
@keyframes tg-guide-land{0%{border-color:#8ce8e2;box-shadow:0 0 0 3px #80dcd022,0 0 18px #b887ff30}45%{border-color:#d0fff9;box-shadow:0 0 0 4px #80dcd038,0 0 26px #b887ff55}100%{border-color:#8ce8e2;box-shadow:0 0 0 3px #80dcd022,0 0 20px #b887ff40}}
.tg-guide-block{position:fixed;pointer-events:auto;background:transparent;touch-action:pan-y}
.tg-guide-coach{position:fixed;box-sizing:border-box;width:min(400px,calc(100vw - 28px));padding:21px 22px;border:1px solid #795c98;border-radius:18px;background:#241a34;color:#f4effb;box-shadow:0 18px 45px #0007;pointer-events:auto;transform-origin:0 0;max-height:calc(100dvh - 32px);overflow:auto}
.tg-guide-coach-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;color:#c6b5dc;font-size:12.5px;font-weight:650}
.tg-guide-coach-head>.tg-guide-small{margin-left:auto}
.tg-guide-progress{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-width:42px;padding:3px 7px;border-radius:7px;background:#75e2da13;color:#94eee1;font-size:12.5px;font-weight:750;font-variant-numeric:tabular-nums}
.tg-guide-coach h3{font-size:19px;line-height:1.35;margin:0 0 11px;color:#faf5ff;font-weight:800;letter-spacing:-.015em}
.tg-guide-coach p{font-size:16px;line-height:1.65;color:#e1d5ee;font-weight:600;margin:0;white-space:normal}
.tg-guide-coach .tg-guide-small{min-height:40px;padding:6px 5px;font-family:inherit;font-size:14px;font-weight:700;border:0;background:transparent;color:#cbbcdc;box-shadow:none}
.tg-guide-coach-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:14px}
.tg-guide-coach .tg-guide-main{width:auto;max-width:75%;min-height:44px;padding:11px 17px;font-family:inherit;font-size:15px;font-weight:750;line-height:1.35;border:1px solid #b899ec;background:linear-gradient(115deg,#9d6ce4,#7451c7);color:#fff;box-shadow:0 5px 14px #0a071d40}
.tg-guide-help{border:0;background:transparent;color:#baa7d5;font:inherit;font-size:.75rem;padding:8px 2px;min-height:40px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.tg-guide-help:hover{color:#e5d0ff}.tg-guide-help:focus-visible{outline:2px solid #75e2da;outline-offset:3px;border-radius:5px}
body.tg-profile-tour .profile-cover-edit,body.tg-profile-tour .profile-avatar-change{opacity:1}
body.tg-profile-tour .profile-cover-edit{z-index:3}
.tg-guide-profile-enter{animation:tg-guide-profile-enter .45s ease both}
@keyframes tg-guide-backdrop{from{opacity:0}to{opacity:1}}
@keyframes tg-guide-backdrop-out{from{opacity:1}to{opacity:0}}
@keyframes tg-guide-profile-enter{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:520px){.tg-guide-copy{padding:20px}.tg-guide-invite{border-radius:18px}.tg-guide-coach{padding:17px 18px}.tg-guide-coach .tg-guide-small{min-height:44px}.tg-guide-coach .tg-guide-main{min-height:44px}.tg-guide-copy p{font-size:.88rem}.tg-guide-coach p{font-size:15.5px}.tg-guide-coach h3{font-size:18px}}
@media(pointer:coarse){body.tg-profile-tour .profile-cover-edit,body.tg-profile-tour .nickname-customize,.tg-guide-help{min-height:44px;min-width:44px}}
@media(prefers-reduced-motion:reduce){.tg-guide-invite,.tg-guide-coach,.tg-guide-hole,.tg-guide-root,.tg-guide-main,body.tg-invite-active .app-shell,body.tg-invite-return .app-shell{transition:none!important;transform:none!important}.tg-guide-invite::backdrop,.tg-guide-invite.tg-leaving::backdrop,.tg-guide-profile-enter,.tg-guide-land{animation:none!important}}
.telegram-header-wordmark{pointer-events:auto!important;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.telegram-header-wordmark:focus-visible{outline:2px solid #8ce8ff;outline-offset:5px;border-radius:5px}
.topbar .brand-icon-home{pointer-events:auto;isolation:isolate}
.flag,.topbar .language-trigger .flag{width:26px!important;height:18px!important;flex-shrink:0;border:1px solid #ffffff38!important;border-radius:3px!important;background-position:center!important;background-size:100% 100%!important;background-repeat:no-repeat!important;background-color:transparent!important;box-shadow:none!important;filter:none!important;transform:none!important;vertical-align:middle}
.flag::before,.flag::after{content:none!important;display:none!important}
.flag-ru{background-image:url('/assets/flag-ru-v2.svg')!important}.flag-uk{background-image:url('/assets/flag-uk-v2.svg')!important}.flag-en{background-image:url('/assets/flag-en-v2.svg')!important}
@media(max-width:600px){
 .profile-card .profile-name-row{gap:8px;align-items:center;flex-wrap:wrap}
 .profile-card .profile-identity{min-height:82px;justify-content:center;gap:0;align-self:start}
 .profile-card .profile-name-row h3{font-size:1.5rem;max-width:calc(100% - 40px);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .tg-profile-details{grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:9px 12px;margin-top:-3px}
 .profile-card .tg-profile-details .profile-badges{display:flex;flex-wrap:wrap;gap:7px;min-width:0;order:0}
 .profile-card .tg-profile-details .rank-badge,.profile-card .tg-profile-details .special-badge{font-size:12px;line-height:1.4;min-height:28px;max-width:100%;font-weight:700}
 .profile-card .tg-profile-details .rank-badge{padding:5px 9px}
 .tg-profile-details>small{font-size:12px;font-weight:600;color:#b5aac7;white-space:nowrap;order:1}
 .tg-profile-tools{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
 .profile-card .tg-profile-tools .nickname-customize,.tg-profile-tools .tg-guide-help{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;height:auto;min-height:44px;margin:0;padding:10px 8px;border:1px solid #715992;border-radius:12px;font:700 13px/1.35 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-decoration:none;white-space:normal;text-align:center}
 .tg-profile-tools .tg-guide-help{background:#ffffff04;border-color:#6b5a7d;color:#d7c8e8}
}

/* Mobile identity: compact titles above the name; one primary action. */
@media(max-width:600px){
 .profile-card .profile-identity{gap:7px;align-self:center;min-height:90px}
 .profile-card .profile-identity>.profile-badges{display:flex;flex-wrap:wrap;gap:5px;margin:0;order:0;min-width:0}
 .profile-card .profile-identity>.profile-name-row{order:1}
 .profile-card .profile-identity>.profile-badges .rank-badge,
 .profile-card .profile-identity>.profile-badges .special-badge{font-size:10px;line-height:1.3;min-height:22px;padding:3px 6px;max-width:100%;font-weight:750}
 .profile-card .profile-identity>.profile-badges .rank-badge{white-space:normal}
 .tg-profile-details{margin-top:0}
 .tg-profile-tools{grid-template-columns:minmax(0,1fr) 58px;gap:9px}
 .tg-profile-tools .tg-guide-help{padding:5px 2px;font-size:12px;border-radius:12px;white-space:nowrap}
 /* Keep the glow static: only composited opacity/translation during travel. */
 .tg-guide-hole{box-shadow:0 0 0 2px #80dcd022;will-change:transform,opacity}
 .tg-guide-coach{box-shadow:0 8px 20px #0005;will-change:transform,opacity}
 .tg-guide-land{animation:tg-guide-mobile-land .6s ease both}
}
@keyframes tg-guide-mobile-land{0%{opacity:.65}50%{opacity:1}75%{opacity:.82}100%{opacity:1}}

/* Four rectangles replace the full-screen polygon mask, including on WebKit. */
.tg-guide-shade{display:none;clip-path:none!important}
.tg-guide-block{background:#080612bb;will-change:transform;backface-visibility:hidden}
.tg-guide-travel .tg-guide-shade{display:block}
.tg-guide-travel .tg-guide-block{visibility:hidden}
body.tg-profile-tour .profile-card .user-avatar,body.tg-profile-tour .profile-card .user-avatar *,body.tg-profile-tour .profile-card .user-avatar::before,body.tg-profile-tour .profile-card .user-avatar::after{animation-play-state:paused!important}
@media(prefers-reduced-motion:reduce){.tg-guide-land{animation:none!important}}

/* Only the coach travels. The spotlight fades at its old position and reveals
   at the final target after the coach arrives; no moving/resizing frame. */
.tg-guide-hole{transition:opacity .18s ease;will-change:opacity}
.tg-guide-land{animation:tg-guide-calm-pulse 2.4s ease-in-out .24s infinite!important}
@keyframes tg-guide-calm-pulse{0%,100%{opacity:1}50%{opacity:.68}}
@media(prefers-reduced-motion:reduce){.tg-guide-land{animation:none!important}}
