/* Color Palette */
:root {
    --imp-blue: #00aaff;
    --imp-blue-dim: rgba(0, 170, 255, 0.5);
    --imperial-red: #8a0303;
    --imperial-red-bright: #ff3333;
    --imperial-red-dim: rgba(138, 3, 3, 0.5);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background: #000;
    color: var(--imp-blue);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* CRT Effects */
#scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 9999;
}

#vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 999;
}

/* Chromatic Aberration on Edges */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    box-shadow:
        inset 0 0 100px rgba(0, 170, 255, 0.1),
        inset 0 0 200px rgba(255, 51, 51, 0.05);
    mix-blend-mode: screen;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s;
}

.screen.active {
    opacity: 1;
}

.screen.hidden {
    display: none;
}

/* Boot Screen */
#console-boot {
    text-align: center;
}

.glitch {
    font-size: 3rem;
    font-weight: 600;
    position: relative;
    animation: glitch 2s infinite;
}

@keyframes glitch {

    0%,
    90%,
    100% {
        transform: translate(0);
    }

    92% {
        transform: translate(-2px, 2px);
    }

    94% {
        transform: translate(2px, -2px);
    }

    96% {
        transform: translate(-2px, -2px);
    }
}

.typewriter {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin: 1rem 0;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.delay-1 {
    animation-delay: 1s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.hud-btn {
    background: transparent;
    border: 2px solid var(--imp-blue);
    color: var(--imp-blue);
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 2rem;
    text-shadow: 0 0 5px var(--imp-blue);
    box-shadow: 0 0 10px var(--imp-blue-dim);
    transition: all 0.3s;
}

.hud-btn:hover {
    background: rgba(0, 170, 255, 0.1);
    box-shadow: 0 0 20px var(--imp-blue);
}

.hidden {
    display: none !important;
}

/* Game Layer */
#hud-layer {
    background: #000;
    overflow: hidden;
}

/* Scrolling Background */
#background-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: scrollBackground 20s linear infinite;
    z-index: 1;
}

@keyframes scrollBackground {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Futuristic Grid Background */
#grid-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 170, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: center bottom;
    animation: gridScroll 10s linear infinite;
    z-index: 0;
    opacity: 0.3;
}

@keyframes gridScroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 50px;
    }
}

/* Nebula Layer */
#nebula-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 50%, rgba(138, 43, 226, 0.15), transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(0, 100, 200, 0.1), transparent 50%);
    animation: nebulaPulse 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes nebulaPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.5;
    }
}

/* Ground */
#ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: linear-gradient(to bottom, #1a1a1a 0%, #0a0a0a 100%);
    border-top: 2px solid #333;
    z-index: 5;
}

#ground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('ground.png');
    background-size: cover;
    background-position: center;
    opacity: 0.6;
}

/* Rocks on ground */
.rock {
    position: absolute;
    background: #2a2a2a;
    border-radius: 50%;
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.5);
}

.rock-1 {
    width: 40px;
    height: 30px;
    bottom: 20%;
    left: 15%;
}

.rock-2 {
    width: 60px;
    height: 45px;
    bottom: 10%;
    left: 45%;
}

.rock-3 {
    width: 35px;
    height: 25px;
    bottom: 25%;
    left: 70%;
}

.rock-4 {
    width: 50px;
    height: 40px;
    bottom: 15%;
    left: 85%;
}

/* HUD Elements */
#target-info {
    display: none;
    /* Hidden per user request */
}

#rebel-status {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: var(--font-mono);
    color: var(--imp-blue);
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border: 1px solid rgba(0, 170, 255, 0.4);
    border-radius: 3px;
    z-index: 100;
}

.label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.value {
    font-size: 1rem;
    font-weight: 600;
}

.imperial {
    color: var(--imperial-red-bright);
}

#integrity-bar-container {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--imp-blue);
    margin: 5px 0;
    position: relative;
}

#target-integrity {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--imp-blue), var(--imperial-red-bright));
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--imp-blue);
}

/* Red Circular Targeting Reticle */
#reticle {
    position: absolute;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 50;
    display: none;
    /* Hidden by default until targeting circle is clicked */
}

/* Outer ring */
#reticle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #ff3333;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.5), inset 0 0 20px rgba(255, 51, 51, 0.3);
    opacity: 0.8;
}

/* Center dot */
#reticle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #ff3333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #ff3333;
}

/* Crosshair lines */
.crosshair-h,
.crosshair-v {
    position: absolute;
    background: var(--imp-blue);
    box-shadow: 0 0 8px var(--imp-blue);
}

.crosshair-h {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.crosshair-v {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

/* Reticle rings */
.ring-middle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 65%;
    height: 65%;
    border: 2px solid #ff3333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.4);
}

.ring-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    border: 2px solid #ff3333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.ring-dotted {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52%;
    height: 52%;
    border: 2px dotted #ff3333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
}

/* Corner brackets */
.bracket {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid #ff3333;
}

.bracket-tl {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.bracket-tr {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.bracket-bl {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.bracket-br {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

/* Phase 2: Lock-on state */
#reticle.locked-on::before {
    border-color: #ff3333;
    box-shadow: 0 0 30px #ff3333, inset 0 0 30px rgba(255, 51, 51, 0.5);
    animation: lockPulse 0.5s ease-in-out infinite, lockRotate 3s linear infinite;
}

#reticle.locked-on::after {
    background: #ff3333;
    box-shadow: 0 0 20px #ff3333, 0 0 40px rgba(255, 51, 51, 0.8);
    animation: lockPulse 0.5s ease-in-out infinite;
}

#reticle.locked-on .bracket {
    border-color: #ff3333;
    box-shadow: 0 0 15px #ff3333;
}

@keyframes lockPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes lockRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Aircraft */
#target {
    position: absolute;
    top: 40%;
    width: 250px;
    /* Increased from 150px */
    height: 170px;
    /* Increased from 100px */
    z-index: 10;
}

.aircraft-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 51, 51, 0.6)) drop-shadow(0 0 30px rgba(0, 170, 255, 0.3));
}

/* Energy trail behind aircraft */
#target::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(0, 170, 255, 0.6), rgba(0, 170, 255, 0.1));
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.8);
    animation: trailPulse 1.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes trailPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Obstacles - Celestial Objects */
.obstacle {
    position: absolute;
    z-index: 8;
    animation: obstacleMove 3s linear forwards;
}

/* Asteroid */
.obstacle-asteroid {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #5a5a5a, #2a2a2a);
    border-radius: 40% 60% 50% 50%;
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.6);
    animation: obstacleMove 4s linear forwards, rotate 8s linear infinite;
}

/* Meteor */
.obstacle-meteor {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 40% 40%, #ff6600, #cc0000);
    border-radius: 50%;
    box-shadow:
        0 0 20px rgb(255, 102, 0),
        inset -3px -3px 8px rgba(0, 0, 0, 0.7);
    animation: obstacleMove 2.5s linear forwards;
}

.obstacle-meteor::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 8px;
    background: linear-gradient(90deg, rgba(255, 102, 0, 0.8), transparent);
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    filter: blur(3px);
}

/* Comet */
.obstacle-comet {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle at 50% 50%, #cce6ff, #0066cc);
    border-radius: 50%;
    box-shadow:
        0 0 15px rgba(0, 200, 255, 0.8),
        inset -2px -2px 6px rgba(0, 0, 0, 0.5);
    animation: obstacleMove 3.5s linear forwards;
}

.obstacle-comet::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 12px;
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.6), transparent);
    right: -100px;
    top: 50%;
    transform: translate Y(-50%);
    border-radius: 50%;
    filter: blur(4px);
}

/* Space Debris */
.obstacle-debris {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #666, #333, #888);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    box-shadow:
        inset -2px -2px 5px rgba(0, 0, 0, 0.8),
        2px 2px 8px rgba(255, 255, 255, 0.2);
    animation: obstacleMove 3s linear forwards, rotate 4s linear infinite;
}

@keyframes obstacleMove {
    from {
        right: -100px;
    }

    to {
        right: 100%;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Crash animation - Multi-stage */
.aircraft-crash {
    animation: realisticCrash 3.5s ease-in forwards !important;
    animation-fill-mode: forwards !important;
}

@keyframes realisticCrash {

    /* Stage 1: Shudder (0-15%) */
    0% {
        transform: rotate(0deg);
    }

    5% {
        transform: translate(-5px, 3px) rotate(-2deg);
    }

    10% {
        transform: translate(5px, -3px) rotate(2deg);
    }

    15% {
        transform: translate(0, 0) rotate(0deg);
        filter: brightness(1.5);
    }

    /* Stage 2: Loss of control/spinning (15-40%) */
    20% {
        top: 42%;
        transform: rotate(30deg);
    }

    30% {
        top: 50%;
        transform: rotate(120deg);
    }

    40% {
        top: 58%;
        transform: rotate(200deg);
    }

    /* Stage 3: Free fall with flames (40-70%) */
    50% {
        top: 65%;
        transform: rotate(250deg);
        filter: brightness(1.8) sepia(0.5);
    }

    60% {
        top: 72%;
        transform: rotate(280deg);
    }

    70% {
        top: 76%;
        transform: rotate(310deg);
    }

    /* Stage 4: Ground impact (70-100%) - stays here */
    85% {
        top: 78%;
        left: 50%;
        transform: rotate(340deg) scale(0.95);
    }

    100% {
        top: 78%;
        /* Land on ground border (ground starts at 80%) */
        left: 50%;
        transform: rotate(345deg) scale(0.9);
        opacity: 0.85;
    }
}

/* Smoke particles */
#smoke-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.smoke-particle {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(100, 100, 100, 0.8), transparent);
    border-radius: 50%;
    animation: smokeRise 1.5s ease-out forwards;
}

@keyframes smokeRise {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    100% {
        opacity: 0;
        transform: scale(3) translateY(-100px);
    }
}

/* Control Panel - Right Side */
#control-panel {
    position: absolute;
    right: 20px;
    right: 20px;
    top: 40%;
    /* Moved up from 50% */
    transform: translateY(-50%);
    width: 280px;
    height: 700px;
    background: rgba(0, 0, 0, 0.85);
    border: 3px solid var(--rebel-blue);
    border-radius: 5px;
    box-shadow:
        0 0 30px rgba(0, 243, 255, 0.5),
        inset 0 0 30px rgba(0, 243, 255, 0.1);
    z-index: 200;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Orbitron', var(--font-mono);
    animation: panelPulse 3s ease-in-out infinite;
    overflow: hidden;
}

/* Holographic scanlines effect */
#control-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 243, 255, 0.03) 2px,
            rgba(0, 243, 255, 0.03) 4px);
    pointer-events: none;
    animation: scanlineMove 8s linear infinite;
    z-index: 10;
}

@keyframes scanlineMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(20px);
    }
}

@keyframes panelPulse {

    0%,
    100% {
        box-shadow:
            0 0 30px rgba(0, 243, 255, 0.5),
            inset 0 0 30px rgba(0, 243, 255, 0.1);
    }

    50% {
        box-shadow:
            0 0 40px rgba(0, 243, 255, 0.7),
            inset 0 0 40px rgba(0, 243, 255, 0.15);
    }
}

.panel-section {
    border: 2px solid rgba(0, 243, 255, 0.4);
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1);
}

/* Top Section */
.panel-top {
    text-align: center;
}

.panel-label {
    font-size: 0.75rem;
    color: rgba(0, 243, 255, 0.7);
    margin-bottom: 5px;
}

.panel-value {
    font-size: 1.1rem;
    color: var(--rebel-blue);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.8);
    margin-bottom: 8px;
}

.panel-sublabel {
    font-size: 0.7rem;
    color: rgba(0, 243, 255, 0.6);
}

#panel-status {
    color: var(--rebel-blue);
    font-weight: 600;
}

/* Weapon Systems */
.panel-weapons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weapon-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weapon-label {
    font-size: 0.75rem;
    color: var(--rebel-blue);
    width: 50px;
}

.weapon-indicator {
    flex: 1;
    height: 8px;
    background: rgba(0, 243, 255, 0.2);
    border: 1px solid var(--rebel-blue);
    position: relative;
    overflow: hidden;
}

.weapon-indicator::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 243, 255, 0.5) 50%,
            transparent 100%);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* Center Targeting Circle */
.panel-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.targeting-circle {
    position: relative;
    width: 180px;
    height: 180px;
    cursor: pointer;
    transition: all 0.3s;
}

.targeting-circle:hover {
    transform: scale(1.05);
}

.targeting-circle:active {
    transform: scale(0.95);
}

.circle-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--rebel-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.ring-1 {
    width: 100%;
    height: 100%;
}

.ring-2 {
    width: 70%;
    height: 70%;
    opacity: 0.8;
}

.ring-3 {
    width: 40%;
    height: 40%;
    opacity: 0.6;
}

.circle-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--rebel-blue);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--rebel-blue);
}

.circle-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--rebel-blue);
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
    pointer-events: none;
}

/* Bottom Tactical Readout */
.panel-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tactical-bar {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tactical-label {
    font-size: 0.7rem;
    color: rgba(0, 243, 255, 0.7);
}

.tactical-value {
    width: 100%;
    height: 12px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.tactical-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--rebel-blue), #66d9ff);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.8);
    transition: width 0.3s;
}

/* Crash Screen - Cockpit Interior View */
#crash-overlay {
    background: url('cockpit_damaged.png') no-repeat center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

/* Red emergency lighting effect */
#crash-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
            transparent 30%,
            rgba(138, 3, 3, 0.2) 60%,
            rgba(138, 3, 3, 0.4) 100%);
    animation: emergencyPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Atmospheric smoke/haze overlay */
#crash-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(50, 50, 50, 0.1) 0%,
            rgba(80, 80, 80, 0.15) 50%,
            rgba(50, 50, 50, 0.2) 100%);
    pointer-events: none;
    z-index: 2;
}

@keyframes emergencyPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes redFlicker {

    0%,
    100% {
        background: rgba(138, 3, 3, 0.3);
    }

    50% {
        background: rgba(0, 0, 0, 0.9);
    }
}

.shake {
    animation: shake 0.5s infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-5px, 5px);
    }

    50% {
        transform: translate(5px, -5px);
    }

    75% {
        transform: translate(-5px, -5px);
    }
}

.crash-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.imperial-red {
    color: var(--imperial-red-bright);
    text-shadow:
        0 0 20px rgba(255, 51, 51, 0.8),
        0 0 40px rgba(255, 51, 51, 0.6),
        0 2px 10px rgba(0, 0, 0, 0.9);
    animation: hudGlitch 3s ease-in-out infinite;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.15em;
}

/* HUD glitch effect */
@keyframes hudGlitch {

    0%,
    90%,
    100% {
        transform: translate(0, 0);
        filter: blur(0);
    }

    92% {
        transform: translate(-3px, 0);
        filter: blur(1px);
    }

    94% {
        transform: translate(3px, 0);
        filter: blur(0);
    }

    96% {
        transform: translate(-2px, 0);
        filter: blur(1px);
    }
}

#crash-log {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-top: 2rem;
    color: rgba(255, 100, 100, 0.9);
    text-shadow:
        0 0 10px rgba(255, 51, 51, 0.6),
        0 1px 5px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 10;
}

/* Artifact Display */
#artifact-display {
    background: url('crashed_aircraft_bg.png') no-repeat center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

/* Fire glow atmospheric effect */
#artifact-display::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse at bottom right,
            rgba(255, 100, 0, 0.15) 0%,
            rgba(255, 150, 50, 0.08) 30%,
            transparent 60%);
    pointer-events: none;
    animation: fireFlicker 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes fireFlicker {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* Enhanced vignette for crash scene */
#artifact-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
            transparent 20%,
            rgba(0, 0, 0, 0.4) 70%,
            rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 1;
}


.header-text {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    z-index: 10;
    color: var(--imp-blue);
    text-shadow:
        0 0 10px var(--imp-blue),
        0 0 20px var(--imp-blue),
        0 0 40px var(--imp-blue);
    letter-spacing: 2px;
    animation: textPulse 2s ease-in-out infinite;
}

.panels-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    align-items: stretch;
    position: relative;
    z-index: 10;
}

.artifact-panel {
    background:
        linear-gradient(135deg, rgba(0, 20, 30, 0.95), rgba(0, 10, 15, 0.98)),
        linear-gradient(rgba(0, 170, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 170, 255, 0.3);
    padding: 2.5rem 2rem;
    width: 420px;
    text-align: center;
    box-shadow:
        0 0 30px rgba(0, 170, 255, 0.1),
        inset 0 0 30px rgba(0, 170, 255, 0.05);
    position: relative;
    z-index: 10;
    clip-path: polygon(20px 0, 100% 0,
            100% calc(100% - 20px), calc(100% - 20px) 100%,
            0 100%, 0 20px);
    transition: transform 0.3s, box-shadow 0.3s;

    transform-origin: center bottom;
    opacity: 0;
    /* Panel animation starts AFTER beam animation (0.8s beam + little overlap) */
    animation: holographicReveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.6s;
    /* Wait for beam to reach top */
}

/* Staggered delay for second panel */
#panel-transmission {
    animation-delay: 0.9s;
    /* 0.6s + 0.3s stagger */
}

#panel-transmission .projection-beam {
    animation-delay: 0.3s;
}

/* Explicit Holographic Beam */
.projection-beam {
    position: absolute;
    top: 100%;
    /* Start at bottom of panel */
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100vh;
    /* Extend to bottom of screen */
    background: linear-gradient(to top, transparent, rgba(0, 170, 255, 0.2) 20%, var(--imp-blue) 90%, #fff 100%);
    box-shadow: 0 0 15px var(--imp-blue), 0 0 30px rgba(0, 170, 255, 0.5);
    z-index: -1;
    transform-origin: bottom;

    /* Beam Animation */
    opacity: 0;
    animation: beamShoot 0.8s ease-out forwards;
}

@keyframes beamShoot {
    0% {
        opacity: 0;
        clip-path: inset(100% 0 0 0);
        /* Hidden */
        filter: brightness(2);
    }

    30% {
        opacity: 1;
        clip-path: inset(80% 0 0 0);
        /* Start visible at bottom */
    }

    100% {
        opacity: 0;
        /* Fade out as panel appears */
        clip-path: inset(0 0 0 0);
        /* Full height */
        filter: brightness(1);
    }
}

@keyframes holographicReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scaleY(0);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        filter: blur(0);
    }
}

/* Old keyframes removed/replaced */

.artifact-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--imp-blue);
    border-left: 2px solid var(--imp-blue);
}

.artifact-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--imp-blue);
    border-right: 2px solid var(--imp-blue);
}

.artifact-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 50px rgba(0, 170, 255, 0.2);
    border-color: var(--imp-blue);
}

.artifact-panel h3 {
    color: var(--imp-blue);
    margin-bottom: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
    padding-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.artifact-panel p {
    margin: 0.5rem 0;
    font-family: var(--font-mono);
}

.volatile {
    color: #ffaa00;
}

.corrupt {
    color: var(--imperial-red-bright);
}

.access-btn {
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid var(--imp-blue);
    color: var(--imp-blue);
    padding: 1rem 3rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-block;
    text-decoration: none;
    line-height: normal;
}

.access-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 170, 255, 0.4), transparent);
    transition: 0.5s;
}

.access-btn:hover {
    background: rgba(0, 170, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
    text-shadow: 0 0 8px var(--imp-blue);
}

.access-btn:hover::before {
    left: 100%;
}

/* Processing UI */
#processing-ui {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.processing-circle {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 51, 51, 0.2);
    border-top: 3px solid var(--imperial-red-bright);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#processing-text {
    font-family: 'Share Tech Mono', monospace;
    color: var(--imperial-red-bright);
    font-size: 0.9rem;
    text-align: center;
    letter-spacing: 1px;
    height: 1.2em;
    /* Prevent layout shift */
    animation: blink 0.5s infinite alternate;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* Crash Scene Smoke Particles */
.crash-smoke-particle {
    position: absolute;
    background: radial-gradient(circle,
            rgba(150, 150, 150, 0.4) 0%,
            rgba(100, 100, 100, 0.2) 50%,
            transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    filter: blur(8px);
    animation: smokeRise 8s ease-out forwards,
        smokeFade 8s ease-out forwards,
        smokeDrift 4s ease-in-out infinite;
}

.crash-smoke-particle.small {
    width: 40px;
    height: 40px;
}

.crash-smoke-particle.medium {
    width: 60px;
    height: 60px;
}

.crash-smoke-particle.large {
    width: 80px;
    height: 80px;
}

@keyframes smokeRise {
    0% {
        transform: translateY(0) scale(0.5);
    }

    100% {
        transform: translateY(-400px) scale(1.5);
    }
}

@keyframes smokeFade {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    70% {
        opacity: 0.4;
    }

    100% {
        opacity: 0;
    }
}

@keyframes smokeDrift {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(30px);
    }
}