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

:root {
    --primary-color: rgba(255, 255, 255, 0.9);
    --background-blur: blur(12px);
    --glass-bg: rgba(18, 18, 18, 0.5);
    --accent-color: #00ff9d;
    --fuel-full: #00ff9d;
    --fuel-low: #ff4d4d;
    --neon-primary: #00ff9d;
    --neon-secondary: #ff003c;
    --cyber-background: rgba(10, 12, 18, 0.98);
}

body {
    margin: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Loading Screen */
.loading-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    visibility: hidden;
}

.loading-container.visible {
    visibility: visible;
}

.loading-text {
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    animation: textFade 2s infinite;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 65%;
    height: 100%;
    background: var(--accent-color);
    animation: progressAnim 2s ease-in-out infinite;
}

/* HUD Styles */
#hud {
    position: fixed;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    visibility: hidden;
}

#hud.visible {
    visibility: visible;
}

.hud-section {
    position: absolute;
    margin: 1.5rem;
}

.left-top {
    left: 0;
    top: 0;
}

.center-top {
    left: 50%;
    top: 0;
}

.right-top {
    right: 0;
    top: 0;
}

.left-bottom {
    left: 0;
    bottom: 0;
}

.info-box {
    background: var(--glass-bg);
    backdrop-filter: var(--background-blur);
    border-radius: 16px;
    padding: 1.2rem;
    min-width: 180px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.info-box:hover {
    transform: translateY(-2px);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.8rem;
}

.icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.info-value {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.2rem;
    font-family: 'Courier New', monospace;
}

.info-unit {
    font-size: 0.9rem;
    opacity: 0.6;
    letter-spacing: 1px;
}

.tilt-indicator {
    margin-top: 1.5rem;
    position: relative;
}

.tilt-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right,
            rgba(255, 50, 50, 0.6) 0%,
            rgba(0, 255, 157, 0.8) 50%,
            rgba(255, 50, 50, 0.6) 100%);
    border-radius: 3px;
    overflow: hidden;
}

.tilt-bubble {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.tilt-bubble::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tilt-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.tilt-degree {
    font-size: 0.7rem;
    opacity: 0.6;
    position: relative;
    top: -2px;
}

.ping-indicator {
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    margin-top: 0.5rem;
    animation: pingPulse 1s infinite;
}

.velocity-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.velocity-bar::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 40%;
    background: var(--accent-color);
    animation: barAnim 1.5s ease-in-out infinite;
}

.fuel-container {
    padding-bottom: 1.5rem;
}

.fuel-indicator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.fuel-warning {
    opacity: 0;
}

.fuel-warning.active {
    animation: fuelPulse 1s infinite;
    box-shadow: 0 0 5px rgba(255, 50, 50, 0.3);
    opacity: 1;
}

.fuel-bar {
    position: relative;
    width: 24px;
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fuel-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            var(--fuel-low) 0%,
            var(--fuel-full) 100%);
    transition: height 0.3s cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: inset 0 0 12px rgba(0, 255, 157, 0.2);
}

.fuel-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 30%);
}

.fuel-percentage {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    opacity: 0.8;
}

.fuel-low-warning {
    animation: fuelPulse 1s infinite;
}

#targetIndicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 18px;
    color: white;
    user-select: none;
}

#targetIndicator #targetArrow {
    font-size: 24px;
    margin-bottom: 4px;
    animation: bounce 1s infinite alternate;
}

#targetDistance.close {
    color: #00ff88;
    animation: farPulse 1s infinite;
}

#targetDistance.medium {
    color: #ffcc00;
    animation: none;
}

#targetDistance.far {
    color: white;
    animation: none;
}

/* Neue Positionierung */
.right-bottom {
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}


/* ================================== Game Over Screen ======================================  */
#gameOverScreen,
#winScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-over-visible {
    opacity: 1 !important;
    pointer-events: all !important;
}

.win-visible {
    opacity: 1 !important;
    pointer-events: all !important;
}

.cyber-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%,
            rgba(0, 255, 157, 0.05) 0%,
            rgba(10, 12, 18, 0.95) 70%);
    backdrop-filter: blur(15px);
}

.morph-container {
    position: relative;
    padding: 4rem;
    border: 2px solid var(--neon-primary);
    border-radius: 16px;
    background: var(--cyber-background);
    box-shadow: 0 0 50px rgba(0, 255, 157, 0.2);
    transform: scale(0.9);
    animation: containerAppear 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.glitch-text {
    font-family: 'Courier New', monospace;
    font-size: 4rem;
    text-align: center;
    color: var(--neon-primary);
    text-shadow: 0 0 15px rgba(0, 255, 157, 0.5);
    position: relative;
    animation: textGlitch 2s infinite;
}

.glitch-text::before {
    content: attr(data-text);
    position: absolute;
    left: -2px;
    text-shadow: 2px 0 rgba(255, 0, 60, 0.5);
    clip: rect(0, 900px, 0, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.hologram-stats {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border-left: 3px solid var(--neon-primary);
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
    font-size: 1.2rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    color: var(--neon-primary);
    font-weight: bold;
}

.neon-buttons {
    display: grid;
    gap: 1.5rem;
}

.cyber-button {
    position: relative;
    padding: 1.2rem 3rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--neon-primary);
    color: var(--neon-primary);
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cyber-button:hover {
    background: rgba(0, 255, 157, 0.1);
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.3);
    transform: translateY(-2px);
}

.cyber-button.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

.button-hologram {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 255, 157, 0.3),
            transparent);
    transition: left 0.6s ease;
}

.cyber-button:hover .button-hologram {
    left: 150%;
}

.win-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.win-buttons button {
    padding: 10px 20px;
    font-size: 1.1rem;
    background-color: #00ff88;
    border: none;
    color: black;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.win-buttons button:hover {
    background-color: #00dd77;
}


/* ================================== Keyframes ======================================  */
@keyframes pingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 157, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 157, 0);
    }
}

@keyframes barAnim {
    0% {
        transform: translateX(-100%);
    }

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

@keyframes textFade {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes progressAnim {
    0% {
        transform: translateX(-5%);
    }

    50% {
        transform: translateX(25%);
    }

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

@keyframes fuelPulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

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

@keyframes tiltWarning {
    0% {
        box-shadow: 0 0 5px rgba(255, 50, 50, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 50, 50, 0.6);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 50, 50, 0.3);
    }
}

@keyframes containerAppear {
    0% {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes textGlitch {

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

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

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

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