/* Сплэш до загрузки JS: внешний файл (CSP: style-src 'self', <style> в HTML запрещён).
   Цвета фона и знака — как --bg-page и --accent в packages/ui/src/styles/tokens.css (синхронно: main.tsx красит
   этим же фоном шапку и фон Telegram, чтобы переход «плейсхолдер Telegram → сплэш → приложение» был без полос). */
#boot-splash {
    --splash-bg: #f3f4f6;
    --splash-accent: #128c80;
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--splash-bg);
    color: var(--splash-accent);
    opacity: 1;
    transition: opacity 180ms ease-out;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) #boot-splash {
        --splash-bg: #0b0c0e;
        --splash-accent: #19a89a;
    }
}
:root[data-theme="dark"] #boot-splash {
    --splash-bg: #0b0c0e;
    --splash-accent: #19a89a;
}
#boot-splash.boot-splash--hide {
    opacity: 0;
    pointer-events: none;
}
#boot-splash .boot-splash__mark {
    width: 96px;
    height: 58px;
}
#boot-splash .boot-splash__bar {
    position: relative;
    width: 72px;
    height: 2px;
    overflow: hidden;
    border-radius: 1px;
    background: color-mix(in srgb, var(--splash-accent) 22%, transparent);
}
#boot-splash .boot-splash__bar::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 36%;
    border-radius: 1px;
    background: var(--splash-accent);
    animation: boot-splash-run 1.1s ease-in-out infinite;
}
@keyframes boot-splash-run {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(280%);
    }
}
@media (prefers-reduced-motion: reduce) {
    #boot-splash {
        transition: none;
    }
    #boot-splash .boot-splash__bar::after {
        animation: none;
        width: 100%;
    }
}
#boot-splash .boot-splash__fail {
    max-width: 80%;
    padding: 12px 16px;
    border: 1px solid currentColor;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font:
        600 15px/1.3 system-ui,
        sans-serif;
    text-align: center;
    cursor: pointer;
}
