/* ===== Фон шапки главной: свечной график BTC в стиле торгового терминала ===== */
.header.header--btc {
    position: relative;
    background: radial-gradient(90% 80% at 80% 20%, rgba(135, 153, 126, 0.22) 0%, rgba(135, 153, 126, 0) 65%),
                linear-gradient(160deg, #2C3336 0%, #323A39 55%, #38413B 100%);
}

/* содержимое шапки поверх графика (поиск .searchHeadForm - fixed, его не трогаем) */
.header--btc > .mobileNav,
.header--btc > .mainNav,
.header--btc > .container {
    position: relative;
    z-index: 1;
}

.hmBtcBg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    animation: hmBtcFade 0.8s ease both;
}

.hmBtcBg canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* затемнение под текстом слева, чтобы контент читался */
.hmBtcShade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(44, 51, 54, 0.7) 0%, rgba(44, 51, 54, 0.4) 36%, rgba(44, 51, 54, 0) 56%),
        linear-gradient(180deg, rgba(44, 51, 54, 0.5) 0%, rgba(44, 51, 54, 0) 20%);
}

/* строка OHLC, как легенда в терминале */
.hmBtcLegendWrap {
    position: absolute;
    top: 134px;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.hmBtcLegend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    font-family: 'Roboto Mono', Consolas, Menlo, monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #D1D4DC;
    font-variant-numeric: tabular-nums;
    animation: hmBtcFade 0.6s 0.4s ease both;
}

.hmBtcLegend[hidden] {
    display: none;
}

.hmBtcLegend span {
    display: inline-flex;
    gap: 5px;
    white-space: nowrap;
}

.hmBtcLegend em {
    font-style: normal;
    color: #787B86;
}

.hmBtcLegend b {
    font-weight: 500;
}

.hmBtcSym {
    align-items: center;
    font-weight: 700;
    color: #fff;
}

.hmBtcSym em {
    font-weight: 400;
}

.hmBtcDot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #87997E;
    animation: hmBtcPulse 2s ease-out infinite;
}

.hmBtcSep {
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hmBtcLegend .is-up { color: #87997E; }
.hmBtcLegend .is-down { color: #E8697A; }

/* внутренние страницы: заголовок по центру - затемняем центр */
.headerPage.header--btc .hmBtcShade {
    background:
        radial-gradient(60% 70% at 50% 55%, rgba(44, 51, 54, 0.72) 0%, rgba(44, 51, 54, 0.35) 60%, rgba(44, 51, 54, 0) 100%),
        linear-gradient(180deg, rgba(44, 51, 54, 0.5) 0%, rgba(44, 51, 54, 0) 30%);
}

.headerPage.header--btc .hmBtcLegendWrap {
    top: 130px;
}

@keyframes hmBtcFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hmBtcPulse {
    0% { box-shadow: 0 0 0 0 rgba(135, 153, 126, 0.6); }
    100% { box-shadow: 0 0 0 7px rgba(135, 153, 126, 0); }
}

@media screen and (max-width: 980px) {
    .hmBtcLegendWrap {
        display: none;
    }

    .hmBtcShade {
        background: linear-gradient(180deg, rgba(44, 51, 54, 0.6) 0%, rgba(44, 51, 54, 0.3) 45%, rgba(44, 51, 54, 0.1) 100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hmBtcBg,
    .hmBtcLegend,
    .hmBtcDot {
        animation: none;
    }
}
