* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cinzel', serif;
    background-color: #000;
    color: #c33333;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

.phase {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.phase.active {
    display: flex;
}

/* Стили для фазы ошибки 404 */
#phase-error {
    background-color: #000;
}

.error-container {
    text-align: center;
}

#error-404 {
    max-width: 90vw;
    max-height: 50vh;
    filter: brightness(0.8);
}

/* Стили для страшной фазы */
#phase-horror {
    background-color: #000;
    opacity: 0;
    transition: opacity 2s ease;
}

.monster-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
}

/* Кровавая табличка */
#blood-plate {
    position: relative;
    background-color: #3a0000;
    border: 8px solid #5a0000;
    border-radius: 15px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.7),
                inset 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
    min-width: 300px;
    max-width: 90vw;
}

.blood-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../media/blood-texture.png');
    background-size: cover;
    mix-blend-mode: multiply;
    opacity: 0.7;
    border-radius: 7px;
}

.blood-content {
    position: relative;
    z-index: 2;
}

#blood-plate h2 {
    font-size: clamp(24px, 5vw, 36px);
    color: #ffcccc;
    text-shadow: 0 0 10px #ff0000,
                 0 0 20px #cc0000;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

#name-input {
    font-family: 'Caveat', cursive;
    font-size: 28px;
    background: rgba(20, 0, 0, 0.8);
    color: #ff9999;
    border: 2px solid #800000;
    border-radius: 5px;
    padding: 10px 20px;
    width: 100%;
    text-align: center;
    outline: none;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

#name-input::placeholder {
    color: #993333;
}

#submit-name {
    margin-top: 20px;
    padding: 10px 30px;
    font-family: 'Cinzel', serif;
    font-size: 20px;
    background: linear-gradient(to bottom, #660000, #330000);
    color: #ffcccc;
    border: 2px solid #990000;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#submit-name:hover {
    background: linear-gradient(to bottom, #880000, #440000);
    box-shadow: 0 0 20px #ff0000;
}

/* Капли крови сверху */
.blood-drip {
    position: absolute;
    top: -50px;
    left: 50%;
    width: 5px;
    height: 50px;
    background: linear-gradient(to bottom, 
                transparent 0%, 
                #ff0000 30%, 
                #990000 70%, 
                transparent 100%);
    animation: drip 2s infinite;
    filter: blur(1px);
}

@keyframes drip {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.blood-drip::before,
.blood-drip::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 15px;
    background: #990000;
    border-radius: 50%;
    top: 100%;
    filter: blur(3px);
}

.blood-drip::before { left: -10px; }
.blood-drip::after { left: 7px; }

/* Фаза с добрым монстром */
#phase-good {
    background-color: #fff;
    opacity: 0;
    transition: opacity 2s ease;
}

#text-messages {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
}

.message {
    font-family: 'Caveat', cursive;
    font-size: clamp(30px, 6vw, 48px);
    color: #000;
    opacity: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 20px 0;
}

/* Анимации */
@keyframes blink {
    0%, 100% { opacity: 1; }
    10%, 30%, 50%, 70%, 90% { opacity: 1; }
    20%, 40%, 60%, 80% { opacity: 0.2; }
}

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

@keyframes scatter {
    0% { 
        opacity: 1;
        transform: translateY(0) rotate(0);
    }
    100% { 
        opacity: 0;
        transform: translateY(100vh) rotate(360deg);
        letter-spacing: 50px;
    }
}

.hidden {
    display: none !important;
}
