@font-face {
    font-family: 'Quake';
    src: url('quake.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 1. The Environment: Quake II Industrial Vibe */
body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    /* Monospace feels like the console, but we'll use it for non-title text if any */
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
}

/* 2. The Target: Gritty Industrial Text */
.quake-text {
    /* Explicitly use the custom Quake font */
    font-family: 'Quake', sans-serif;
    font-size: 5rem;
    /* Increased size for impact */
    font-weight: 900;
    text-transform: uppercase;
    color: #8c7b6c;
    /* Rusty metal color */
    position: relative;
    cursor: crosshair;
    /* Adds to the FPS feel */
    letter-spacing: 4px;
    transition: color 0.1s;

    /* Simulate a dirty texture with text-shadow */
    text-shadow: 2px 2px 0px #000, -1px -1px 0px #3a3a3a;
}

/* 3. The Railgun Slug (The Beam) */
.quake-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    /* Start off-screen left */
    width: 0%;
    height: 6px;

    /* The iconic Q2 Railgun Blue/White spiral look */
    background: repeating-linear-gradient(90deg,
            transparent 0%,
            rgba(100, 200, 255, 0.8) 20%,
            #ffffff 50%,
            rgba(100, 200, 255, 0.8) 80%,
            transparent 100%);

    box-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
    /* Neon Glow */
    transform: translateY(-50%) skewX(-20deg);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

/* 4. The Action: Hover Trigger */
.quake-text:hover {
    color: #ff3333;
    /* Flash red on hit */
    text-shadow:
        0 0 10px #ff0000,
        0 0 20px #8b0000;
    /* Blood/Damage Glow */

    /* The violent shake animation */
    animation: impact-shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Trigger the railgun shot animation */
.quake-text:hover::before {
    animation: rail-shot 0.3s ease-out forwards;
}

/* 5. Animations */

/* The Beam shooting across */
@keyframes rail-shot {
    0% {
        left: -10%;
        width: 20%;
        opacity: 1;
    }

    50% {
        width: 120%;
        /* Stretch across the text */
        opacity: 1;
    }

    100% {
        left: 110%;
        /* Exit right */
        width: 10%;
        opacity: 0;
        /* Fade out like a smoke trail */
    }
}

/* The "Gib" Shake */
@keyframes impact-shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0) rotate(-1deg);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0) rotate(2deg);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0) rotate(-2deg);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0) rotate(1deg);
    }
}
