body {
    background-color: black;
    color: white;
    font-family: 'Times New Roman', serif;
    margin: 0;
    padding: 0;
}

.saga-container {
    max-width: 800px; /* Сделали уже, чтобы не было "широко" */
    margin: 50px auto;
    padding: 20px;
}

.saga-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 80px;
    gap: 30px;
}

.saga-text {
    flex: 1.5;
    text-align: center;
}
/* Эффект стекания для слова */
.dripping-word {
    position: relative;
    display: inline-block;
    color: white;
    vertical-align: top;
}

.dripping-word::after {
    content: 'далееее'; /* Должно совпадать с текстом в span */
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: white;
    overflow: hidden;
    transform-origin: top;
    
    /* Сама анимация стекания */
    animation: drip 4s ease-in-out infinite;
    
    /* Эффект размытия хвоста, чтобы было похоже на жидкость */
    filter: blur(1px);
    opacity: 0.8;
}

@keyframes drip {
    0% {
        transform: scaleY(1);
        clip-path: inset(0 0 0 0);
    }
    50% {
        transform: scaleY(15); /* Длина струи вниз */
        clip-path: inset(0 0 0 0);
    }
    80% {
        opacity: 0;
        transform: scaleY(20);
    }
    100% {
        transform: scaleY(1);
        opacity: 0;
    }
}

/* Стили для красной ссылки X */
/* Ссылка X */
.blood-link {
    display: inline-block;
    color: #ff0000;
    text-decoration: none;
    font-size: 3.5rem;
    font-weight: bold;
    position: relative;
    z-index: 10;
}

/* Струя крови */
.blood-link::after {
    content: '';
    position: absolute;
    
    /* Сдвигаем чуть правее центра */
    left: 65%; 
    top: 80%; 
    
    width: 4px; 
    background: linear-gradient(to bottom, #ff0000, #4a0000);
    border-radius: 0 0 5px 5px;
    
    /* Начальное состояние (кровь внутри буквы) */
    height: 0;
    opacity: 0;
    pointer-events: none;

    /* Плавный возврат (когда мышку убрали) */
    transition: height 0.8s ease-in, opacity 0.5s ease;
}

/* Состояние при наведении (кровь течет вниз) */
.blood-link:hover::after {
    height: 400px; /* Длина струи */
    opacity: 1;
    
    /* Плавное вытекание (когда навели) */
    transition: height 2s ease-out, opacity 0.3s ease;
}

@keyframes dripBlood {
    0% {
        height: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
        height: 10px;
    }
    100% {
        height: 400px; /* Длина струи (настрой под себя) */
        opacity: 0.8;
        box-shadow: 0 0 10px #ff0000; /* Легкое кровавое свечение */
    }
}

.back-link {
    display: block;
    text-align: center;
    color: #555; /* Изначально серый цвет */
    text-decoration: none;
    margin-top: 50px;
    margin-bottom: 50px;
    font-size: 1rem;
    font-family: 'Times New Roman', serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.4s ease; /* Плавный переход */
}

.back-link:hover {
    color: #ff0000; /* При наведении становится красной */
    text-shadow: 0 0 10px #ff0000; /* Добавляем кровавое свечение */
    letter-spacing: 5px; /* Буквы немного разъезжаются */
    transform: scale(1.1); /* Ссылка чуть увеличивается */
}

.invisible-trigger {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: auto;
    height: auto;
    z-index: 1000;
    
    /* Игнорируем наведение на пустую область вокруг */
    pointer-events: none; 
    
    opacity: 0;
    transition: opacity 5s ease-in-out;
}

.invisible-trigger:hover {
    opacity: 1;
}

/* Быстрое исчезновение */
.invisible-trigger:not(:hover) {
    transition: opacity 0.4s ease;
}

.invisible-trigger img {
    /* Настраиваем размер зоны клика здесь */
    width: 70px; 
    cursor: pointer;
    
    /* ВКЛЮЧАЕМ наведение только для самой картинки */
    pointer-events: auto; 
    display: block;
}


/* Состояние "поломки" */
body.crashed {
    background-image: url('images/illegalinstruction.png') !important;
    background-size: cover !important;
    background-attachment: fixed;
    background-color: black !important;
    overflow: hidden;

    /* Цветокоррекция: убиваем лишние цвета, оставляем глубокий синий */
    filter: grayscale(1) contrast(200%) brightness(0.4) sepia(1) hue-rotate(200deg) saturate(2000%);
}

/* Синий туман (Overlay) */
body.crashed::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background: rgba(0, 10, 50, 0.4);
    backdrop-filter: blur(1.5px); /* Легкое расплывание как на скринах */
}

/* Горизонтальные полосы (Scanlines) для эффекта глитча */
body.crashed::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        rgba(0, 0, 0, 0.2) 2px,
        transparent 4px
    );
}

/* Эффект "разъехавшихся" элементов */
body.crashed .saga-row:nth-child(odd) {
    transform: translateX(40px) skewX(8deg);
    filter: drop-shadow(-10px 0 5px rgba(0, 50, 255, 0.5));
}

body.crashed .saga-row:nth-child(even) {
    transform: translateX(-40px) skewX(-8deg);
    filter: drop-shadow(10px 0 5px rgba(0, 50, 255, 0.5));
}

/* Соник и фото при поломке становятся тенями */
body.crashed img {
    filter: brightness(0.6) contrast(1.2) blur(0.5px);
}

body.crashed .saga-text h2, 
body.crashed .saga-text p {
    position: relative;
    color: rgba(0, 150, 255, 1); /* Сделали светлее */
    text-shadow: 2px 2px 0px #000;
    display: inline-block;
    
    /* ВАЖНО: это выведет текст из-под общего темного фильтра body */
    filter: brightness(2.5) contrast(1.5); 
    z-index: 100;
}

/* Создаем ПЕРВЫЙ разрез (верхняя часть) */
body.crashed .saga-text h2::before, 
body.crashed .saga-text p::before {
    content: attr(data-text);
    position: absolute;
    left: -15px; 
    top: 0;
    width: 100%;
    clip-path: inset(0 0 70% 0); 
    color: #0044ff;
    z-index: 1;
    /* Добавили эти три строки: */
    pointer-events: none;
    text-transform: inherit;
    white-space: nowrap;
}

/* Создаем ВТОРОЙ разрез (средняя часть) */
body.crashed .saga-text h2::after, 
body.crashed .saga-text p::after {
    content: attr(data-text);
    position: absolute;
    left: 20px; 
    top: 0;
    width: 100%;
    clip-path: inset(40% 0 35% 0); 
    color: #00aaff;
    z-index: 2;
    /* Добавили эти три строки: */
    pointer-events: none;
    text-transform: inherit;
    white-space: nowrap;
}