@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Share+Tech+Mono&display=swap');

:root {
    --ra2-green: #4aff4a;
    --ra2-red: #ff3333;
    --ra2-gold: #d4af37;
    --ra2-dark: #111;
    --ra2-panel: #1a1a1a;
}

body {
    background-color: #000;
    color: var(--ra2-green);
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    cursor: crosshair;

    /* Fog of War Background */
    background-image:
        radial-gradient(circle at 50% 50%, rgba(0, 20, 0, 0.4) 0%, rgba(0, 0, 0, 1) 90%),
        repeating-linear-gradient(transparent, transparent 2px, rgba(0, 0, 0, 0.5) 2px, rgba(0, 0, 0, 0.5) 4px),
        url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZmlsdGVyIGlkPSJub2lzZUZpbHRlciI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNjUiIG51bSBPY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PCGZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbW9pc2VGaWx0ZXIpIiBvcGFjaXR5PSIwLjI1Ii8+PC9zdmc+');
    background-size: cover, 100% 4px, 400px 400px;
    animation: fog-move 60s linear infinite;
}

/* CRT Screen Transition Effects */
.screen-off {
    animation: turn-off 0.3s cubic-bezier(0.9, 0, 1, 1) forwards;
}

.screen-on {
    animation: turn-on 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes turn-off {
    0% {
        transform: scale(1, 1.3) translate3d(0, 0, 0);
        filter: brightness(1);
        opacity: 1;
    }

    60% {
        transform: scale(1.3, 0.001) translate3d(0, 0, 0);
        filter: brightness(10);
    }

    100% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: scale(0, 0.0001) translate3d(0, 0, 0);
        opacity: 0;
    }
}

@keyframes turn-on {
    0% {
        transform: scale(1, 0.8) translate3d(0, 0, 0) translateY(100%);
        opacity: 0;
    }

    100% {
        transform: scale(1, 1) translate3d(0, 0, 0) translateY(0);
        opacity: 1;
    }
}

/* Radar Enhancements */
.radar-grid {
    background-image:
        linear-gradient(rgba(0, 255, 0, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 50%;
}

.radar-sweep {
    background: conic-gradient(from 0deg, transparent 0deg, rgba(0, 255, 0, 0.1) 60deg, rgba(0, 255, 0, 0.5) 90deg, transparent 91deg);
    animation: sweep 4s infinite linear;
    border-radius: 50%;
}

@keyframes sweep {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Random Blip Animation */
.radar-blip {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 5px #0f0;
    opacity: 0;
    animation: blip 3s infinite;
}

.radar-blip:nth-child(1) {
    top: 30%;
    left: 60%;
    animation-delay: 1s;
}

.radar-blip:nth-child(2) {
    top: 70%;
    left: 40%;
    animation-delay: 2.5s;
}

@keyframes blip {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* Clock Enhancements */
#clock {
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    letter-spacing: 1px;
}

@keyframes fog-move {
    0% {
        background-position: center, 0 0, 0 0;
    }

    100% {
        background-position: center, 0 0, 200px 200px;
    }
}

.font-header {
    font-family: 'Russo One', sans-serif;
}

/* Scanline Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 50;
}

/* CRT Flicker */
@keyframes flicker {
    0% {
        opacity: 0.97;
    }

    5% {
        opacity: 0.95;
    }

    10% {
        opacity: 0.9;
    }

    15% {
        opacity: 0.95;
    }

    20% {
        opacity: 0.99;
    }

    25% {
        opacity: 0.95;
    }

    30% {
        opacity: 0.9;
    }

    35% {
        opacity: 0.96;
    }

    40% {
        opacity: 0.98;
    }

    45% {
        opacity: 0.95;
    }

    50% {
        opacity: 0.99;
    }

    55% {
        opacity: 0.93;
    }

    60% {
        opacity: 0.9;
    }

    65% {
        opacity: 0.96;
    }

    70% {
        opacity: 1;
    }

    75% {
        opacity: 0.97;
    }

    80% {
        opacity: 0.95;
    }

    85% {
        opacity: 0.92;
    }

    90% {
        opacity: 0.98;
    }

    95% {
        opacity: 0.95;
    }

    100% {
        opacity: 0.98;
    }
}

.crt-flicker {
    animation: flicker 0.15s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

/* Kirov Red Alert Effect */
.kirov-alert {
    position: fixed;
    inset: 0;
    background: rgba(255, 0, 0, 0.3);
    z-index: 50;
    pointer-events: none;
    animation: kirov-flash 0.5s infinite alternate;
    mix-blend-mode: overlay;
}

@keyframes kirov-flash {
    from {
        opacity: 0.2;
        background: rgba(255, 0, 0, 0.1);
    }

    to {
        opacity: 0.6;
        background: rgba(255, 0, 0, 0.4);
    }
}

::-webkit-scrollbar-track {
    background: #111;
    border-left: 1px solid #333;
}

::-webkit-scrollbar-thumb {
    background: var(--ra2-red);
    border: 1px solid var(--ra2-gold);
}

/* UI Elements */
.ra2-border {
    border: 2px solid #444;
    box-shadow:
        inset 1px 1px 0px rgba(255, 255, 255, 0.1),
        inset -1px -1px 0px rgba(0, 0, 0, 0.5),
        0 0 0 1px #000;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.ra2-btn {
    background: linear-gradient(to bottom, #2b2b2b, #1a1a1a);
    border: 1px solid #555;
    color: #aaa;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

/* Electric Jitter Animation for Tesla Effect */
@keyframes electric-jitter {
    0% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-1px, 1px);
    }

    40% {
        transform: translate(1px, -1px);
    }

    60% {
        transform: translate(-1px, -1px);
    }

    80% {
        transform: translate(1px, 1px);
    }

    100% {
        transform: translate(0, 0);
    }
}

.ra2-btn:hover,
.ra2-btn.active {
    background: linear-gradient(to bottom, #003333, #001111);
    border-color: #00ffff;
    color: #fff;
    text-shadow: 0 0 8px #00ffff;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 255, 0.5),
        0 0 5px rgba(0, 255, 255, 0.5);
    animation: electric-jitter 0.15s infinite;
    z-index: 1;
    /* Ensure pop over other elements */
}

.ra2-btn::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.text-glow-green {
    text-shadow: 0 0 5px var(--ra2-green);
}

.text-glow-red {
    text-shadow: 0 0 5px var(--ra2-red);
}

.typing-cursor::after {
    content: '█';
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Radar Sweep Animation */
@keyframes radar-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* CLI Input Styling */
#cli-input {
    caret-color: var(--ra2-green);
}

#cli-input::selection {
    background: var(--ra2-green);
    color: black;
}