:root {
    --bg: #F6F8FB;
    --surface: #FFFFFF;
    --surface-2: #EFF3F9;
    --fg: #16191D;
    --muted: #5F6B7A;
    --accent: #2C6BED;
    --accent-ink: #FFFFFF;
    --accent-soft: rgba(44, 107, 237, .10);
    --border: #E1E7F0;
    --good: #1E9E63;
    --error: #D2453F;
    --warn: #B7791F;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --shadow-lg: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 48px rgba(16, 24, 40, .10);

    --primary: var(--surface-2);
    --secondary: var(--surface);

    --radius: 14px;
    --radius-lg: 20px;
    --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171C;
        --surface: #1B1F26;
        --surface-2: #222831;
        --fg: #ECEFF3;
        --muted: #97A1AF;
        --accent: #6E9BFF;
        --accent-ink: #0F1218;
        --accent-soft: rgba(110, 155, 255, .14);
        --border: #2A313B;
        --good: #46C08A;
        --error: #F0736D;
        --warn: #E0B15A;
        --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 8px 24px rgba(0, 0, 0, .28);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, .32), 0 18px 48px rgba(0, 0, 0, .40);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html { overflow-y: scroll; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }

#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 92%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 92%);
}

.site-header {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 650; font-size: 17px; letter-spacing: -.2px; color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 6px; font-size: 15px; }
.nav-links a {
    color: var(--muted); padding: 7px 12px; border-radius: 9px;
    transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }

.hero { padding: 92px 0 64px; text-align: center; position: relative; }
.hero h1 {
    font-size: 56px; margin: 0 0 14px;
    letter-spacing: -1.6px; font-weight: 700; line-height: 1.08;
}
.hero .tagline {
    font-size: 21px; color: var(--fg); opacity: .9;
    margin: 0 auto 20px; max-width: 620px; font-weight: 450;
}
.hero .lead { font-size: 16.5px; color: var(--muted); max-width: 560px; margin: 0 auto 34px; }

.version-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 15px; font-size: 13px; color: var(--muted);
    margin-bottom: 26px; box-shadow: var(--shadow);
    transition: border-color .15s, color .15s;
}
.version-badge:hover { color: var(--fg); border-color: var(--accent); text-decoration: none; }
.version-badge .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--good);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent);
}

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 11px;
    font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
    border: 1px solid var(--border); background: var(--surface); color: var(--fg);
    box-shadow: var(--shadow);
    transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent); color: var(--accent-ink); border-color: transparent;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 20px color-mix(in srgb, var(--accent) 26%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--accent-ink); }

.section { padding: 64px 0; position: relative; }
.section h2 { font-size: 31px; margin: 0 0 10px; text-align: center; letter-spacing: -.7px; }
.section .sub { text-align: center; color: var(--muted); margin: 0 auto 44px; max-width: 560px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.feature .ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-bottom: 16px;
    border-radius: 12px; color: var(--accent);
    background: var(--accent-soft); border: none;
}
.feature .ic svg { width: 22px; height: 22px; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-bottom: 16px;
    border-radius: 12px; color: var(--accent); font-size: 17px; font-weight: 700;
    background: var(--accent-soft); border: none;
}
.feature h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.2px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

.chat-demo {
    max-width: 420px; margin: 44px auto 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px;
    box-shadow: var(--shadow-lg); text-align: left;
}
.chat-row { display: flex; margin-bottom: 10px; }
.chat-row.out { justify-content: flex-end; }
.bubble {
    max-width: 78%; padding: 9px 14px; border-radius: 16px;
    font-size: 14.5px; line-height: 1.45;
    background: var(--surface-2); color: var(--fg);
    border-bottom-left-radius: 5px;
    animation: bubble-in .5s ease both;
}
.chat-row.out .bubble {
    background: var(--accent); color: var(--accent-ink);
    border-bottom-left-radius: 16px; border-bottom-right-radius: 5px;
}
.chat-row:nth-child(1) .bubble { animation-delay: .05s; }
.chat-row:nth-child(2) .bubble { animation-delay: .35s; }
.chat-row:nth-child(3) .bubble { animation-delay: .65s; }
.chat-row:nth-child(4) .bubble { animation-delay: .95s; }
.bubble .meta { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }

.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing i {
    width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
    animation: typing 1.25s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes typing {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30%           { opacity: 1;   transform: translateY(-3px); }
}

.call-demo {
    max-width: 430px; margin: 44px auto 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px;
    box-shadow: var(--shadow-lg); text-align: left;
}
.call-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.call-avatar {
    width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 700; font-size: 17px; letter-spacing: -.5px;
}
.call-who { min-width: 0; }
.call-name { font-weight: 600; font-size: 15.5px; }
.call-state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.call-state .live {
    width: 7px; height: 7px; border-radius: 50%; background: var(--good);
    animation: live-pulse 1.9s ease-in-out infinite;
}
.call-timer { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.call-wave { display: flex; align-items: center; gap: 2px; height: 48px; margin-bottom: 18px; }
.call-wave i {
    flex: 1 1 auto; border-radius: 3px; background: var(--accent); opacity: .55;
    transform-origin: center;
    animation: wave 1.35s ease-in-out infinite;
}
.call-wave i:nth-child(6n+1) { animation-duration: 1.1s;  animation-delay: .00s; }
.call-wave i:nth-child(6n+2) { animation-duration: 1.5s;  animation-delay: .12s; }
.call-wave i:nth-child(6n+3) { animation-duration: 1.25s; animation-delay: .26s; }
.call-wave i:nth-child(6n+4) { animation-duration: 1.65s; animation-delay: .07s; }
.call-wave i:nth-child(6n+5) { animation-duration: 1.2s;  animation-delay: .33s; }
.call-wave i:nth-child(6n+6) { animation-duration: 1.45s; animation-delay: .19s; }

.call-wave.is-scripted i { animation: none; height: 100%; will-change: transform; }

.call-actions { display: flex; gap: 10px; }
.call-btn {
    flex: 1 1 0; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface-2); color: var(--fg); border: 1px solid var(--border);
    font-size: 13.5px; font-weight: 600;
}
.call-btn svg { width: 18px; height: 18px; }
.call-btn.is-end { background: var(--error); border-color: transparent; color: #fff; }

.call-foot {
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px;
}

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 650; letter-spacing: .3px; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
}
.hero .chip { margin-bottom: 14px; }
.chip-center { display: block; width: fit-content; margin: 0 auto 14px; }

.note {
    max-width: 680px; margin: 26px auto 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    font-size: 13.5px; color: var(--muted); line-height: 1.65;
}
.note strong { color: var(--fg); font-weight: 600; }

@keyframes wave {
    0%, 100% { height: 22%; opacity: .40; }
    50%      { height: 100%; opacity: .75; }
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); }
    70%      { opacity: .85; box-shadow: 0 0 0 6px transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .bubble, .typing i { animation: none !important; }
    .call-wave i, .call-state .live { animation: none !important; }
    .call-wave i { height: 55%; }
    .feature { transition: none; }
}

.changelog { max-width: 760px; margin: 0 auto; }
.release {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 26px; margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.release-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.release-ver { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.release-date { color: var(--muted); font-size: 13px; }
.release-title { color: var(--accent); font-size: 15px; margin-bottom: 12px; font-weight: 550; }
.release ul { margin: 0; padding-left: 20px; }
.release li { margin: 5px 0; font-size: 14.5px; color: var(--muted); }

.tag {
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted);
}
.tag-mandatory { color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.tag-beta { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.tag-stable { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }

.dl-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 30px; max-width: 620px; margin: 0 auto 24px;
    text-align: center; box-shadow: var(--shadow);
}
.dl-card .ver { font-size: 27px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.5px; }
.dl-meta { color: var(--muted); font-size: 13px; margin: 8px 0 20px; }
.req-list { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 14px; text-align: left; }
/* Счётчик загрузок над сетками платформ. */
.dl-total {
    display: flex; align-items: center; gap: 9px;
    width: fit-content; margin: -24px auto 40px;
    padding: 8px 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 14px; color: var(--muted);
}
.dl-total svg { width: 17px; height: 17px; color: var(--accent); flex: 0 0 auto; }
.dl-total strong { color: var(--fg); font-weight: 650; font-variant-numeric: tabular-nums; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; }
.dl-grid .dl-card { max-width: none; margin: 0; }
.dl-platform { font-size: 19px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.dl-grid .req-list { max-width: none; }
.req-list li { margin: 6px 0; }
code {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 6px; padding: 1px 6px; font-size: 12.5px;
}

.form-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px; max-width: 640px; margin: 0 auto;
    box-shadow: var(--shadow);
}
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 13px; color: var(--muted); font-weight: 550; }
.form-row input, .form-row textarea, .form-row select {
    background: var(--bg); border: 1px solid var(--border); color: var(--fg);
    border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row textarea { min-height: 110px; resize: vertical; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert-ok { background: color-mix(in srgb, var(--good) 12%, transparent); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); color: var(--good); }
.alert-err { background: color-mix(in srgb, var(--error) 12%, transparent); border: 1px solid color-mix(in srgb, var(--error) 40%, transparent); color: var(--error); }

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 26px 0; position: relative; z-index: 1; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); gap: 12px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; }

.yr { position: relative; display: inline-block; font-variant-numeric: tabular-nums; }
.yr-t { display: inline-block; transition: opacity .28s ease; }
.yr-m {
    position: absolute; inset: 0;
    display: flex; align-items: center;
    white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity .28s ease;
}
.yr-m > span { flex: 1 1 0; min-width: 0; text-align: center; }
.yr.is-swapped .yr-t { opacity: 0; }
.yr.is-swapped .yr-m { opacity: 1; pointer-events: auto; cursor: pointer; }
.yr.is-glitch .yr-m { text-shadow: 0.6px 0 rgba(255, 0, 80, .40), -0.6px 0 rgba(0, 190, 255, .40); }

@media (prefers-reduced-motion: reduce) {
    .yr-t, .yr-m { transition-duration: .01ms; }
    .yr.is-glitch .yr-m { text-shadow: none; }
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tg-game {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    animation: g-in .22s ease both;
}
@keyframes g-in { from { opacity: 0; } to { opacity: 1; } }

.tg-stage {
    position: relative;
    width: min(920px, 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.tg-stage canvas { display: block; width: 100%; height: auto; touch-action: manipulation; }

.tg-close {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); cursor: pointer; padding: 0;
}
.tg-close svg { display: block; }
.tg-close:hover { color: var(--fg); }

.tg-panel {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; text-align: center; padding: 24px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
}
.tg-panel[hidden] { display: none; }
.tg-panel h3 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.tg-panel p { margin: 0; color: var(--muted); font-size: 14px; max-width: 380px; }
.tg-score { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.tg-best { color: var(--muted); font-size: 13px; }

@media (max-width: 600px) {
    .tg-game { padding: 10px; }
    .tg-panel h3 { font-size: 19px; }
    .tg-score { font-size: 36px; }
}

@media (max-width: 820px) {
    .features { grid-template-columns: 1fr; }
    .hero { padding: 64px 0 48px; }
    .hero h1 { font-size: 40px; letter-spacing: -1px; }
    .hero .tagline { font-size: 19px; }
    .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 600px) {
    .nav { flex-direction: column; height: auto; gap: 8px; padding: 12px 0; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 4px; width: 100%; }
    .hero { padding: 44px 0 36px; }
    .hero h1 { font-size: 34px; }
    .section { padding: 44px 0; }
    .chat-demo { margin-top: 34px; }
    .call-wave { gap: 1px; }
}