.memorial-candle {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    position: relative;
    z-index: 1;
    padding-top: 30px;
}
.candle-holder {
    width: 150px;
    height: 400px;
    position: relative;
    margin: 0 auto;
}

.candle-holder *,
.candle-holder *:before,
.candle-holder *:after {
    position: absolute;
    content: "";
}

.candle {
    bottom: 0;
    width: 150px;
    height: 300px;
    border-radius: 150px / 40px;
    box-shadow:
            inset 20px -30px 50px 0 rgba(0, 0, 0, 0.4),
            inset -20px 0 50px 0 rgba(0, 0, 0, 0.4);
    background: linear-gradient(#e48825, #e78e0e, #833c03, #4c1a03 50%, #1c0900);
}
.candle.active {
    animation: candlePulse 0.5s ease 3;
}

.candle:before {
    width: 145px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #d47401;
    background: radial-gradient(#eaa121, #8e4901 45%, #b86409 80%);
}

.candle:after {
    width: 34px;
    height: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    top: 14px;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.5);
    background: radial-gradient(rgba(0, 0, 0, 0.6), transparent 45%);
}

.thread {
    width: 6px;
    height: 36px;
    top: -17px;
    left: 50%;
    z-index: 1;
    border-radius: 40% 40% 0 0;
    transform: translateX(-50%);
    background: linear-gradient(#d6994a, #4b232c, #121212, black, #e8bb31 90%);
}

.flame {
    width: 24px;
    height: 120px;
    left: 50%;
    transform-origin: 50% 100%;
    transform: translateX(-50%);
    bottom: 100%;
    border-radius: 50% 50% 20% 20%;
    background: linear-gradient(white 80%, transparent);
    animation:
            moveFlame 6s linear infinite,
            enlargeFlame 5s linear infinite,
            flicker 2s ease-in-out infinite;
    box-shadow: 0 0 15px 0 rgba(247, 93, 0, 0.4),
    0 -6px 4px 0 rgba(247, 128, 0, 0.7);
}

.glow {
    width: 26px;
    height: 60px;
    border-radius: 50% 50% 35% 35%;
    left: 50%;
    top: -48px;
    transform: translateX(-50%);
    background: rgba(0, 133, 255, 0.7);
    box-shadow:
            0 -40px 30px 0 #dc8a0c,
            0 40px 50px 0 #dc8a0c,
            inset 3px 0 2px 0 rgba(0, 133, 255, 0.6),
            inset -3px 0 2px 0 rgba(0, 133, 255, 0.6);
}

.glow:before {
    width: 70%;
    height: 60%;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
}

.blinking-glow {
    width: 100px;
    height: 180px;
    left: 50%;
    top: -55%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #d63030;
    filter: blur(60px);
    animation: blinkIt 0.1s infinite;
}

@keyframes moveFlame {
    0%, 100% { transform: translateX(-50%) rotate(-2deg); }
    50% { transform: translateX(-50%) rotate(2deg); }
}

@keyframes enlargeFlame {
    0%, 100% { height: 120px; }
    50% { height: 140px; }
}

@keyframes blinkIt {
    50% { opacity: 0.8; }
}

@keyframes flicker {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.7; }
}
@keyframes candlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.candle-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #b22222;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.candle-btn:hover {
    background: #a30000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.candle-counter {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #cccccc;
}
.candle-text {
    margin-top: 30px;
    font-style: italic;
    color: #cccccc;
    position: relative;
    text-align: center;
}
.candle-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(to right, transparent, #b22222, transparent);
}
.candle-message {
    color: white;
    font-size: 1.5rem;
    text-align: center;
    margin-top: 30px;
    animation: fadeIn 1s ease;
}

@media screen and (max-width: 550px) {
    .memorial
    {
        display:block;
    }
    .memorial-candle
    {
        width:100%;
        margin-top: 70px;
    }
}

.memorial-candle-wrap
{
    position: relative;
    z-index: 100;
}
.memorial-candle-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -50px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    z-index: -1;

    /* Создаем эффект размытых границ */
    box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.3),
            0 0 40px 20px rgba(0, 83, 138, 0.5);

    /* Градиентная маска для плавного перехода */
    mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 30%,
            black 70%,
            transparent 100%
    ), linear-gradient(
            to bottom,
            transparent 0%,
            black 70%,
            black 85%,
            transparent 100%
    );
    mask-composite: intersect;
}