body {
    font-family: 'Khand', sans-serif;
    background-color: #020617; 
    color: #f8fafc;
    margin: 0;
    overflow: hidden;
    touch-action: manipulation;
}

.font-serif { font-family: 'Instrument Serif', serif !important; }
.font-mono { font-family: 'Space Mono', monospace !important; }

/* Tech-Grid Background from ALX */
.blueprint-grid {
    background-color: #020617;
    background-image:
        linear-gradient(to right, rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* UI Panels Starten Unsichtbar */
.reveal-ui {
    opacity: 0;
    transform: translateY(20px);
}
.play-reveal {
    animation: slideUpFade 1s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpFade {
    to { opacity: 1; transform: translateY(0); }
}

/* ALX Glassmorphismus-Panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    transition: all 0.3s ease;
}
.glass-panel:hover {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.data-value {
    font-family: 'Space Mono', monospace;
    color: #00ffff;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}
.data-value.purple {
    color: #d946ef;
    text-shadow: 0 0 12px rgba(217, 70, 239, 0.3);
}

.data-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 500;
}

/* Schieberegler */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 8px 0;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 3px; cursor: pointer; background: #334155; border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
    height: 16px; width: 16px; border-radius: 50%; background: #00ffff; cursor: pointer; -webkit-appearance: none; margin-top: -6.5px; box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}
@media (max-width: 768px) {
    input[type=range]::-webkit-slider-thumb {
        height: 24px; width: 24px; margin-top: -10.5px;
    }
}

button:active { transform: scale(0.97); }

.modal-enter { animation: modalPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes modalPop {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Glitch Animation für das Intro */
@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}
.glitch-effect {
    animation: glitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #fff;
    text-shadow: 2px 0 #0ff, -2px 0 #f0f;
}

/* Анимация вспышки при ударе */
.flash-impact { animation: flashText 0.5s ease-out; }
@keyframes flashText {
    0% { text-shadow: 0 0 40px #fff, 0 0 60px #00F0FF; color: #fff; transform: scale(1.05); }
    100% { text-shadow: 0 0 20px rgba(0,240,255,0.6); color: #fff; transform: scale(1); }
}

/* 3D HUD & Scanner Effekte */
.perspective-container {
    perspective: 1000px;
    transform-style: preserve-3d;
}
.hud-3d {
    transform: rotateX(60deg) rotateZ(-15deg);
    transform-style: preserve-3d;
}
.scanner-line {
    width: 100%; 
    height: 2px;
    background: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 15px #0ff, 0 0 30px #0ff, 0 0 50px #0ff;
    position: absolute;
    z-index: 50;
    animation: scan 4s ease-in-out infinite;
    opacity: 0.7;
}
@keyframes scan { 
    0% { top: -10%; opacity: 0; } 
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { top: 110%; opacity: 0; } 
}
.blur-reveal {
    animation: blurReveal 2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}
@keyframes blurReveal {
    0% { filter: blur(20px); opacity: 0; transform: scale(0.85); text-shadow: 0 0 40px #0ff; }
    100% { filter: blur(0); opacity: 1; transform: scale(1); text-shadow: 0 0 15px rgba(255,255,255,0.4); }
}

.terminal-text {
    font-family: 'Space Mono', monospace;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0,255,255,0.5);
    font-size: 0.7rem;
    line-height: 1.6;
}

/* Eigene Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Wissenschaftliche Formel-Box (Academic LaTeX Style) */
.math-box {
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid #d946ef;
    padding: 16px 24px;
    font-family: 'Times New Roman', Times, serif;
    color: #e2e8f0;
    border-radius: 0 12px 12px 0;
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.3);
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    margin-top: 16px;
    margin-bottom: 16px;
    overflow-x: auto;
    white-space: nowrap;
}

.math-box i { 
    font-style: italic; 
    font-family: 'Times New Roman', Times, serif;
    color: inherit; 
}

.math-box sub, .math-box sup {
    font-size: 0.7em;
}

/* Akademischer Textstil mit Khand */
.academic-text p, .academic-text ul, .academic-text ol {
    font-family: 'Khand', sans-serif;
    font-size: 1.3rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.75);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.academic-text strong {
    font-weight: 600;
    color: #f8fafc;
}
