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

:root {
    --terminal-green: #33ff33;
    --terminal-dark-green: #00cc00;
    --terminal-bg: #000000;
    --glow-color: #00ff00;
}

.green-bright {
    fill: #66ff66;
}

.green {
    fill: #00ff00;
}

.green-dark {
    fill: #00cc00;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: var(--terminal-green);
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.crt {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--terminal-bg);
    overflow: hidden;
}

.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

.stripe {
    width: 100%;
    height: 20vmin;
    filter: blur(40px);
    opacity: 0.1;
    position: absolute;
    top: -100%;
    animation: stripeAnim 8s linear infinite;
    z-index: 1;
}

.green-stripe {
    background-color: #00ff00;
    animation-delay: 4s;
}

.dark-stripe {
    background-color: #006600;
}

@keyframes stripeAnim {
    50% {
        top: 110%;
    }
    100% {
        top: 110%;
    }
}

@keyframes flicker {
    0% { 
        opacity: 0.27861;
        filter: brightness(1) contrast(1);
    }
    5% { 
        opacity: 0.34769;
        filter: brightness(1.1) contrast(1.2);
    }
    10% { 
        opacity: 0.23604;
        filter: brightness(0.9) contrast(0.95);
    }
    15% { 
        opacity: 0.90626;
        filter: brightness(1.3) contrast(1.1) hue-rotate(2deg);
    }
    20% { 
        opacity: 0.18128;
        filter: brightness(0.8) contrast(0.9);
    }
    25% { 
        opacity: 0.83891;
        filter: brightness(1.2) contrast(1.15);
    }
    30% { 
        opacity: 0.65583;
        filter: brightness(1) contrast(1);
    }
    35% { 
        opacity: 0.67807;
        filter: brightness(1.05) contrast(1.05);
    }
    40% { 
        opacity: 0.26559;
        filter: brightness(0.85) contrast(0.9) hue-rotate(-1deg);
    }
    45% { 
        opacity: 0.84693;
        filter: brightness(1.15) contrast(1.1);
    }
    50% { 
        opacity: 0.96019;
        filter: brightness(1.4) contrast(1.2) hue-rotate(1deg);
    }
    55% { 
        opacity: 0.08594;
        filter: brightness(0.7) contrast(0.8);
    }
    60% { 
        opacity: 0.20313;
        filter: brightness(0.8) contrast(0.85);
    }
    65% { 
        opacity: 0.71988;
        filter: brightness(1.1) contrast(1.05);
    }
    70% { 
        opacity: 0.53455;
        filter: brightness(0.95) contrast(0.95);
    }
    75% { 
        opacity: 0.37288;
        filter: brightness(0.9) contrast(0.9);
    }
    80% { 
        opacity: 0.71428;
        filter: brightness(1.05) contrast(1.05);
    }
    85% { 
        opacity: 0.70419;
        filter: brightness(1.05) contrast(1);
    }
    90% { 
        opacity: 0.7003;
        filter: brightness(1) contrast(1) hue-rotate(-0.5deg);
    }
    95% { 
        opacity: 0.36108;
        filter: brightness(0.9) contrast(0.95);
    }
    100% { 
        opacity: 0.24387;
        filter: brightness(0.85) contrast(0.9);
    }
}

.terminal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--terminal-green);
    border-radius: 10px;
    box-shadow: 0 0 20px var(--glow-color), 
                inset 0 0 20px rgba(0, 255, 0, 0.1);
    padding: 20px;
    animation: turn-on 2s ease-out;
    z-index: 10;
}

@keyframes turn-on {
    0% {
        transform: translate(-50%, -50%) scale(1, 0.01);
        filter: brightness(30);
    }
    35% {
        transform: translate(-50%, -50%) scale(1, 0.01);
        filter: brightness(30);
    }
    70% {
        transform: translate(-50%, -50%) scale(1, 1);
        filter: brightness(1.5);
    }
    100% {
        transform: translate(-50%, -50%) scale(1, 1);
        filter: brightness(1);
    }
}

.terminal-header {
    border-bottom: 1px solid var(--terminal-green);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.terminal-title {
    font-size: 14px;
    text-shadow: 0 0 10px var(--glow-color);
}

.terminal-body {
    min-height: 450px;
    position: relative;
}

.logo-container {
    text-align: center;
    margin: 30px 0;
}

.logo {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 0 10px var(--glow-color)) drop-shadow(0 0 20px var(--glow-color));
    animation: logo-glitch 5s infinite;
}

.logo-text {
    fill: var(--terminal-green);
    font-family: 'Courier New', monospace;
    font-size: 36px;
    font-weight: bold;
}

@keyframes logo-glitch {
    0%, 90%, 100% {
        filter: drop-shadow(0 0 10px var(--glow-color));
        transform: translate(0) scale(1);
    }
    91% {
        filter: drop-shadow(0 0 15px var(--glow-color)) brightness(1.5);
        transform: translate(0) scale(1.02);
    }
    92% {
        filter: drop-shadow(0 0 10px var(--glow-color)) 
                drop-shadow(3px 3px 0 rgba(255, 100, 100, 0.5)) 
                drop-shadow(-3px -3px 0 rgba(100, 255, 255, 0.5));
        transform: translate(3px, -1px) scale(0.98);
    }
    93% {
        filter: drop-shadow(0 0 10px var(--glow-color)) brightness(0.8) contrast(1.2);
        transform: translate(-2px, 1px) scale(1.01);
    }
    94% {
        filter: drop-shadow(0 0 10px var(--glow-color)) 
                drop-shadow(-3px 3px 0 rgba(255, 100, 100, 0.5)) 
                drop-shadow(3px -3px 0 rgba(100, 255, 255, 0.5));
        transform: translate(-1px, 2px) scale(0.99);
    }
    95% {
        filter: drop-shadow(0 0 20px var(--glow-color)) brightness(1.3) saturate(1.5);
        transform: translate(1px, -1px) scale(1.02);
    }
}

.terminal-content {
    padding: 20px 0;
}

.terminal-line {
    margin: 10px 0;
    font-size: 16px;
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
    opacity: 0.9;
    animation: textFlicker 10s infinite;
}

@keyframes textFlicker {
    0%, 95%, 100% {
        text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
        transform: translate(0);
    }
    96% {
        text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color),
                     2px 2px 2px rgba(255, 0, 0, 0.3), -2px -2px 2px rgba(0, 255, 255, 0.3);
        transform: translate(1px, 0);
    }
    97% {
        text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color),
                     -2px 2px 2px rgba(255, 0, 0, 0.3), 2px -2px 2px rgba(0, 255, 255, 0.3);
        transform: translate(-1px, 0);
    }
}

.blink {
    animation: cursor-blink 1s infinite;
}

.cursor {
    display: inline-block;
    margin-left: 2px;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.typing {
    font-size: 24px;
    font-weight: 700;
    margin: 30px 0;
    text-shadow: 0 0 15px var(--glow-color), 0 0 30px var(--glow-color);
    animation: textFlicker 10s infinite, glowPulse 2s ease-in-out infinite;
    min-height: 1.2em;
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 15px var(--glow-color), 0 0 30px var(--glow-color);
    }
    50% {
        text-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color), 0 0 60px var(--glow-color);
    }
}

.sub-text {
    font-size: 14px;
    color: var(--terminal-dark-green);
}

.status {
    color: #ffaa00;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.progress {
    color: var(--terminal-green);
}

.terminal-footer {
    position: absolute;
    bottom: 10px;
    right: 20px;
}

.impressum-link {
    color: var(--terminal-dark-green);
    text-decoration: none;
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.impressum-link:hover {
    opacity: 1;
    text-shadow: 0 0 5px var(--glow-color);
}

.impressum-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: var(--terminal-bg);
    border: 2px solid var(--terminal-green);
    border-radius: 5px;
    box-shadow: 0 0 30px var(--glow-color);
    z-index: 1000;
}

.impressum-modal:target {
    display: block;
}

.impressum-content {
    padding: 20px;
    position: relative;
}

.impressum-content::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.impressum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--terminal-green);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.impressum-header span {
    font-size: 14px;
    text-shadow: 0 0 5px var(--glow-color);
}

.close {
    color: var(--terminal-green);
    text-decoration: none;
    font-size: 16px;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--terminal-green);
    color: var(--terminal-bg);
}

.impressum-body {
    font-size: 12px;
    line-height: 1.6;
}

.impressum-body p {
    margin: 5px 0;
    text-shadow: 0 0 3px var(--glow-color);
}

@media (max-width: 768px) {
    .terminal {
        width: 95%;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .terminal-body {
        min-height: auto;
    }
    
    .logo-container {
        margin: 20px 0;
    }
    
    .logo {
        width: 250px;
    }
    
    .typing {
        font-size: 24px;
        margin: 20px 0;
    }
    
    .terminal-line {
        font-size: 14px;
    }
    
    .terminal-content {
        padding: 10px 0;
    }
}