



@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes heartbeat {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
    100% { opacity: 0.7; transform: scale(1); }
}

@keyframes floatUpFade {
    0% { transform: translate(-50%, -50%); opacity: 1; }
    100% { transform: translate(-50%, -150%); opacity: 0; }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Terror Vignette (Blood Overlay) */
.terror-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5; /* Below UI elements but above map background if z-index matches */
    /* Actually needs to be above map but below interactions? 
       In layout, map is z-index auto. Panels are z-index.
       Let's put it high but pointer-events none makes it safe. */
    z-index: 100;
    background: radial-gradient(circle, transparent 40%, rgba(80, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 1s ease-in-out, background 1s ease;
    mix-blend-mode: multiply;
}

.terror-vignette.pulse {
    animation: heartbeat 1.5s infinite ease-in-out;
}

/* Sound System */
.noise-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.fx-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
}

.noise-marker {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: var(--accent-yellow);
    animation: bounce 2s infinite;
}

.noise-marker svg {
    width: 60%;
    height: 60%;
    filter: drop-shadow(0 0 2px black);
}

.sound-ripple {
    position: absolute;
    border: 2px solid rgba(234, 179, 8, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.5);
    animation: ripple-expand 0.6s ease-out forwards;
}

@keyframes ripple-expand {
    0% { width: 0; height: 0; opacity: 0.8; }
    100% { opacity: 0; }
}

/* Damage Floater */
.damage-floater {
    position: absolute;
    font-weight: bold;
    font-size: 24px;
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    z-index: 30;
    animation: floatUpFade 1.5s forwards;
    white-space: nowrap;
}

/* Screen Shake Class */
.shake-effect {
    animation: shake 0.5s;
    animation-iteration-count: 1;
}

/* QTE System Styles */
.qte-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    transition: filter 0.3s, opacity 0.3s;
}

.qte-container.blurred {
    filter: blur(5px);
    opacity: 0.5;
}

.qte-timer-bar {
    width: 300px;
    height: 10px;
    background: #333;
    border: 1px solid #666;
    border-radius: 5px;
    overflow: hidden;
}

.qte-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
    width: 100%;
    transform-origin: left;
}

.qte-arrows {
    display: flex;
    gap: 10px;
    position: relative;
    align-items: center;
}

.qte-arrow {
    width: 40px;
    height: 40px;
    background: #1f1f22;
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999;
    z-index: 2;
}

.qte-arrow.active {
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.qte-arrow.success {
    background: #14532d;
    border-color: #22c55e;
    color: #22c55e;
}

.qte-arrow.fail {
    background: #7f1d1d;
    border-color: #ef4444;
    color: #ef4444;
}

.qte-divider {
    width: 2px;
    height: 60px;
    background: #555;
    margin: 0 8px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.qte-divider-label {
    position: absolute;
    bottom: -20px;
    font-size: 10px;
    color: #888;
    white-space: nowrap;
    text-transform: uppercase;
}

/* QTE On-Screen Controls */
.qte-controls {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.qte-btn-row {
    display: flex;
    gap: 8px;
}

.qte-btn {
    width: 50px;
    height: 50px;
    background: #1f1f22;
    border: 1px solid #666;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 0 #000;
    transition: transform 0.1s, box-shadow 0.1s;
}

.qte-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #000;
    background: #4c1d95;
    border-color: #8b5cf6;
}

/* Countdown Overlay */
.qte-countdown-overlay {
    position: absolute;
    top: 35%; 
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    text-align: center;
}

.qte-countdown-text {
    font-size: 4rem;
    font-weight: bold;
    color: #eab308;
    text-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
    font-family: 'Cinzel', serif;
}