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

body {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal-container {
    width: 800px;
    height: 600px;
    background: #000;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.3),
        inset 0 0 50px rgba(0, 255, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.terminal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(
            90deg,
            transparent 50%,
            rgba(0, 255, 0, 0.03) 50%
        );
    background-size: 2px 100%;
    pointer-events: none;
    z-index: 1;
}

.terminal-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(
            0deg,
            transparent 50%,
            rgba(0, 255, 0, 0.02) 50%
        );
    background-size: 100% 2px;
    pointer-events: none;
    z-index: 2;
}

.terminal-header {
    background: #111;
    padding: 8px 16px;
    border-bottom: 1px solid #333;
    text-align: center;
}

.terminal-title {
    color: #00ff00;
    font-weight: bold;
    font-size: 12px;
}

.terminal-subtitle {
    color: #00aa00;
    font-size: 10px;
    margin-top: 2px;
}

.terminal-screen {
    height: calc(100% - 60px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 3;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #000;
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #000;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: #00aa00;
}

.boot-message {
    margin-bottom: 16px;
}

.boot-message div {
    margin-bottom: 4px;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.terminal-prompt {
    color: #00ff00;
    margin-right: 4px;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    color: #00ff00;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    white-space: pre;
}

.terminal-cursor {
    color: #00ff00;
    animation: blink 1s infinite;
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hidden-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.output-line {
    margin: 2px 0;
    word-wrap: break-word;
}

.command-line {
    color: #00ff00;
}

.error {
    color: #ff4444;
}

.file-content {
    color: #ffff00;
    margin: 8px 0;
    padding-left: 16px;
}

.directory {
    color: #00ffff;
}

.file {
    color: #ffffff;
}

.text-green {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.text-amber {
    color: #ffb000;
    text-shadow: 0 0 5px rgba(255, 176, 0, 0.5);
}

.text-cyan {
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.text-white {
    color: #ffffff;
}

@media (max-width: 900px) {
    .terminal-container {
        width: 95vw;
        height: 70vh;
        margin: 20px;
    }
    
    body {
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .terminal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    body {
        font-size: 11px;
    }
}

/* CRT Glitch Effects */
.glitch-flicker {
    animation: flicker 0.15s ease-in-out;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.glitch-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 2px;
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        transparent 30%,
        rgba(255, 255, 255, 0.8) 35%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.8) 65%,
        transparent 70%,
        transparent 100%
    );
    transform: skew(-15deg);
    animation: scan-line 0.5s linear;
    pointer-events: none;
    z-index: 10;
}

@keyframes scan-line {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.glitch-static {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    background-size: 10px 10px, 15px 15px, 8px 8px;
    animation: static 0.3s linear;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: overlay;
}

@keyframes static {
    0% {
        background-position: 0px 0px, 0px 0px, 0px 0px;
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        background-position: 50px 50px, -30px 30px, 20px -20px;
        opacity: 0;
    }
}

.glitch-brightness {
    animation: brightness-pulse 0.2s ease-in-out;
}

@keyframes brightness-pulse {
    0%, 100% { 
        filter: brightness(1) contrast(1);
    }
    50% { 
        filter: brightness(1.2) contrast(1.1);
    }
}

.glitch-distortion {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 255, 0, 0.03) 25%,
        rgba(255, 0, 0, 0.03) 50%,
        rgba(0, 0, 255, 0.03) 75%,
        transparent 100%
    );
    animation: rgb-shift 0.4s linear;
    pointer-events: none;
    z-index: 8;
    mix-blend-mode: overlay;
}

@keyframes rgb-shift {
    0% {
        transform: translateX(-100px) skew(-5deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(100px) skew(5deg);
        opacity: 0;
    }
}

.character-glitch {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ff4444;
    animation: char-corrupt 0.1s ease-in-out;
}

@keyframes char-corrupt {
    0%, 100% {
        background-color: transparent;
        color: inherit;
    }
    50% {
        background-color: rgba(255, 255, 255, 0.3);
        color: #ff4444;
        text-shadow: 0 0 5px #ff4444;
    }
}