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

body {
    font-family: 'Courier New', Courier, monospace;
    background: #0a0a0a;
    color: #0ccc68;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* CRT curved screen effect */
body::before {
    content: "";
    position: fixed;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 65%,
        rgba(0, 0, 0, 0.4) 75%,
        rgba(0, 0, 0, 0.8) 85%,
        rgba(0, 0, 0, 1) 100%
    );
    pointer-events: none;
    z-index: 100;
}

/* Screen edge vignette */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
    pointer-events: none;
    z-index: 99;
}

/* Scanlines */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(12, 204, 104, 0.03) 51%,
        transparent 52%,
        transparent 100%
    );
    background-size: 100% 4px;
    animation: scanlines-move 8s linear infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes scanlines-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Flicker effect */
@keyframes flicker {
    0% { 
        opacity: 1;
        filter: brightness(1.2) contrast(1.1);
    }
    4% { 
        opacity: 0.92;
        filter: brightness(0.9) contrast(1.15);
    }
    6% { 
        opacity: 1;
        filter: brightness(1.2) contrast(1.1);
    }
    8% { 
        opacity: 0.88;
        filter: brightness(0.85) contrast(1.2);
    }
    9% { 
        opacity: 1;
        filter: brightness(1.25) contrast(1.08);
    }
    11% { 
        opacity: 0.94;
        filter: brightness(0.95) contrast(1.12);
    }
    20% { 
        opacity: 1;
        filter: brightness(1.2) contrast(1.1);
    }
    60% { 
        opacity: 1;
        filter: brightness(1.2) contrast(1.1);
    }
    61% { 
        opacity: 0.96;
        filter: brightness(1.1) contrast(1.15);
    }
    62% { 
        opacity: 1;
        filter: brightness(1.2) contrast(1.1);
    }
    64% { 
        opacity: 0.9;
        filter: brightness(0.88) contrast(1.18);
    }
    65% { 
        opacity: 1;
        filter: brightness(1.22) contrast(1.1);
    }
    75% { 
        opacity: 0.93;
        filter: brightness(0.92) contrast(1.14);
    }
    100% { 
        opacity: 1;
        filter: brightness(1.2) contrast(1.1);
    }
}

/* Intense flicker for dramatic effect */
@keyframes intense-flicker {
    0%, 100% {
        opacity: 1;
        filter: brightness(1) contrast(1.1) saturate(1);
    }
    2% {
        opacity: 0.6;
        filter: brightness(0.5) contrast(1.5) saturate(0.8);
    }
    4% {
        opacity: 0.9;
        filter: brightness(1.3) contrast(0.9) saturate(1.2);
    }
    6% {
        opacity: 0.4;
        filter: brightness(0.3) contrast(2) saturate(0.5);
    }
    8% {
        opacity: 1;
        filter: brightness(1.5) contrast(0.8) saturate(1.3);
    }
    10% {
        opacity: 0.8;
        filter: brightness(0.8) contrast(1.2) saturate(0.9);
    }
    12%, 90% {
        opacity: 1;
        filter: brightness(1) contrast(1.1) saturate(1);
    }
    92% {
        opacity: 0.85;
        filter: brightness(0.85) contrast(1.3) saturate(0.95);
    }
    94% {
        opacity: 1;
        filter: brightness(1.1) contrast(1.05) saturate(1.05);
    }
    96% {
        opacity: 0.7;
        filter: brightness(0.6) contrast(1.4) saturate(0.85);
    }
    98% {
        opacity: 1;
        filter: brightness(1.2) contrast(1) saturate(1.1);
    }
}

/* Random flicker class */
.random-flicker {
    animation: random-flicker-animation 0.1s infinite;
}

@keyframes random-flicker-animation {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Terminal container */
.terminal-container {
    width: 90%;
    max-width: 900px;
    height: 600px;
    position: relative;
    z-index: 2;
    filter: brightness(1.2) contrast(1.1);
    animation: flicker 15s infinite;
}

.terminal-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border: 2px solid #0a5530;
    border-radius: 5px;
    padding: 30px;
    box-shadow: 
        0 0 100px rgba(12, 204, 104, 0.5),
        inset 0 0 50px rgba(12, 204, 104, 0.1),
        0 0 20px rgba(12, 204, 104, 0.8);
    position: relative;
    overflow: hidden;
}

/* Phosphor glow effect */
.terminal-screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(12, 204, 104, 0.05) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Terminal header */
.terminal-header {
    color: #0ccc68;
    font-size: 12px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #0a5530;
    letter-spacing: 2px;
    text-shadow: 
        0.8px 0 0 rgba(255, 0, 0, 0.25),
        -0.8px 0 0 rgba(0, 255, 255, 0.25),
        0 0 10px rgba(12, 204, 104, 0.8),
        0 0 3px rgba(12, 204, 104, 0.4);
    animation: text-glow 2s ease-in-out infinite;
    transform: scaleY(0.95) scaleX(1.03);
    filter: blur(0.4px) contrast(1.2);
    -webkit-font-smoothing: none;
}

@keyframes text-glow {
    0%, 100% { 
        text-shadow: 
            0.8px 0 0 rgba(255, 0, 0, 0.25),
            -0.8px 0 0 rgba(0, 255, 255, 0.25),
            0 0 10px rgba(12, 204, 104, 0.8),
            0 0 3px rgba(12, 204, 104, 0.4);
    }
    50% { 
        text-shadow: 
            1px 0 0 rgba(255, 0, 0, 0.3),
            -1px 0 0 rgba(0, 255, 255, 0.3),
            0 0 15px rgba(12, 204, 104, 1),
            0 0 5px rgba(12, 204, 104, 0.5);
    }
}

/* Terminal content */
.terminal-content {
    font-size: 16px;
    line-height: 1.8;
    color: #0ccc68;
    position: relative;
    height: calc(100% - 50px);
    overflow-y: auto;
    overflow-x: hidden;
    font-weight: 500;
    text-shadow: 
        0.5px 0 0 rgba(255, 0, 0, 0.3),
        -0.5px 0 0 rgba(0, 255, 255, 0.3),
        0 0 2px rgba(12, 204, 104, 0.4),
        0 0 3px rgba(12, 204, 104, 0.3);
    letter-spacing: 0.05em;
    transform: scaleX(1.02);
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    filter: contrast(1.1);
}

.terminal-content::-webkit-scrollbar {
    width: 0;
}

#terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-line {
    margin: 5px 0;
    opacity: 0;
    animation: line-appear 0.1s forwards;
}

@keyframes line-appear {
    to { opacity: 1; }
}

/* Typing animation */
.typing {
    overflow: hidden;
    white-space: nowrap;
    margin: 5px 0;
    letter-spacing: 1px;
}

/* Menu options */
.menu-option {
    margin: 15px 0;
    padding-left: 20px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    transform: scaleY(0.98);
    filter: blur(0.2px);
}

.menu-option::before {
    content: ">";
    position: absolute;
    left: 0;
    color: #0ccc68;
    text-shadow: 
        0.5px 0 0 rgba(255, 0, 0, 0.2),
        -0.5px 0 0 rgba(0, 255, 255, 0.2);
}

.menu-option:hover {
    color: #1aff88;
    text-shadow: 0 0 20px rgba(26, 255, 136, 1);
    padding-left: 30px;
}

.menu-option:hover::before {
    animation: blink 0.5s infinite;
}

/* Blinking cursor */
.cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: #0ccc68;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
    box-shadow: 0 0 10px rgba(12, 204, 104, 0.8);
}

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

/* Character fade-in effect */
.char {
    opacity: 0;
    animation: char-glow 0.1s forwards;
    display: inline-block;
    transform: scaleY(0.98) scaleX(1.02);
    filter: blur(0.3px);
}

@keyframes char-glow {
    0% {
        opacity: 0;
        color: #1aff88;
        text-shadow: 
            0.8px 0 0 rgba(255, 0, 0, 0.5),
            -0.8px 0 0 rgba(0, 255, 255, 0.5),
            0 0 30px rgba(26, 255, 136, 1);
        filter: blur(0.8px);
    }
    100% {
        opacity: 1;
        color: #0ccc68;
        text-shadow: 
            0.5px 0 0 rgba(255, 0, 0, 0.3),
            -0.5px 0 0 rgba(0, 255, 255, 0.3),
            0 0 10px rgba(12, 204, 104, 0.8);
        filter: blur(0.3px);
    }
}

/* Glow line effects */
.glow-line-horizontal {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(12, 204, 104, 0.1) 10%,
        rgba(12, 204, 104, 0.4) 45%,
        #0ccc68 50%,
        rgba(12, 204, 104, 0.4) 55%,
        rgba(12, 204, 104, 0.1) 90%,
        transparent 100%
    );
    box-shadow: 
        0 0 10px rgba(12, 204, 104, 0.8),
        0 0 20px rgba(12, 204, 104, 0.6),
        0 0 30px rgba(12, 204, 104, 0.4),
        0 -5px 40px rgba(12, 204, 104, 0.3),
        0 -10px 60px rgba(12, 204, 104, 0.2),
        0 -20px 80px rgba(12, 204, 104, 0.15),
        0 -30px 100px rgba(12, 204, 104, 0.1),
        0 -40px 120px rgba(12, 204, 104, 0.08),
        0 -60px 150px rgba(12, 204, 104, 0.05);
    pointer-events: none;
    z-index: 4;
    animation: glow-sweep-down 12s linear infinite;
    opacity: 0.7;
}

/* Additional tail effect */
.glow-line-horizontal::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 100px;
    top: -50px;
    background: linear-gradient(180deg,
        rgba(12, 204, 104, 0.05) 0%,
        rgba(12, 204, 104, 0.08) 20%,
        rgba(12, 204, 104, 0.1) 40%,
        rgba(12, 204, 104, 0.15) 60%,
        rgba(12, 204, 104, 0.2) 80%,
        transparent 100%
    );
    filter: blur(8px);
    pointer-events: none;
}

@keyframes glow-sweep-down {
    0% {
        top: -10%;
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    95% {
        opacity: 0.7;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}


/* Interference bands */
.interference-band {
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(12, 204, 104, 0.02) 2px,
        rgba(12, 204, 104, 0.02) 4px
    );
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: interference-pulse 8s ease-in-out infinite;
}

@keyframes interference-pulse {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scaleY(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(300px) scaleY(3);
    }
}

/* Static noise overlay */
@keyframes noise {
    0%, 100% { 
        background-position: 0 0;
    }
    20% { 
        background-position: -10px 5px;
    }
    40% { 
        background-position: 10px -5px;
    }
    60% { 
        background-position: -5px 10px;
    }
    80% { 
        background-position: 5px -10px;
    }
}

.terminal-screen::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(12, 204, 104, 0.02) 2px,
            rgba(12, 204, 104, 0.02) 4px
        );
    pointer-events: none;
    animation: noise 0.5s steps(2) infinite;
}

/* Boot sequence flash */
@keyframes boot-flash {
    0% {
        background: #000;
        opacity: 0;
    }
    10% {
        background: #0f3600;
        opacity: 1;
    }
    15% {
        background: #000;
        opacity: 1;
    }
    20% {
        background: #0a2400;
        opacity: 1;
    }
    30%, 100% {
        background: #000;
        opacity: 1;
    }
}

.terminal-screen {
    animation: boot-flash 2s ease-out;
}

/* Burn-in effect classes */
.burn-in {
    position: absolute;
    color: #0ccc68;
    opacity: 0.15;
    filter: blur(0.8px);
    text-shadow: 
        0 0 20px rgba(12, 204, 104, 0.3),
        0 0 40px rgba(12, 204, 104, 0.2);
    pointer-events: none;
    z-index: -1;
    animation: burn-fade 120s ease-out forwards;
}

@keyframes burn-fade {
    0% { 
        opacity: 0.15;
        filter: blur(0.8px);
    }
    50% {
        opacity: 0.08;
        filter: blur(1.2px);
    }
    100% { 
        opacity: 0.03;
        filter: blur(2px);
    }
}

.burn-in-permanent {
    position: absolute;
    color: #0a8850;
    opacity: 0.06;
    filter: blur(1px) contrast(0.8);
    text-shadow: 0 0 15px rgba(12, 204, 104, 0.2);
    pointer-events: none;
    z-index: -2;
    transform: translate(1px, 1px);
}

/* Ghost image overlay for persistent elements */
.ghost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.04;
    filter: blur(1.5px);
    background: 
        linear-gradient(180deg, 
            transparent 0%, 
            rgba(12, 204, 104, 0.02) 30%,
            rgba(12, 204, 104, 0.01) 70%,
            transparent 100%);
    mix-blend-mode: screen;
}

/* Header burn-in specific */
.terminal-header {
    position: relative;
}

.terminal-header::after {
    content: attr(data-text);
    position: absolute;
    top: 2px;
    left: 2px;
    color: #0a8850;
    opacity: 0.08;
    filter: blur(1.2px);
    text-shadow: 0 0 20px rgba(12, 204, 104, 0.15);
    z-index: -1;
    animation: header-burn 60s ease-in-out infinite;
}

@keyframes header-burn {
    0%, 100% {
        opacity: 0.08;
        transform: translate(2px, 2px);
    }
    25% {
        opacity: 0.06;
        transform: translate(1px, 3px);
    }
    50% {
        opacity: 0.07;
        transform: translate(3px, 1px);
    }
    75% {
        opacity: 0.05;
        transform: translate(1px, 2px);
    }
}

/* Menu burn-in traces */
.menu-burn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.menu-burn-item {
    position: absolute;
    color: #0a8850;
    opacity: 0.05;
    filter: blur(1.5px);
    text-shadow: 0 0 25px rgba(12, 204, 104, 0.1);
    animation: menu-ghost 180s ease-out forwards;
}

@keyframes menu-ghost {
    0% {
        opacity: 0.05;
        filter: blur(1.5px);
    }
    100% {
        opacity: 0.02;
        filter: blur(3px);
    }
}

/* Link styling */
a {
    color: inherit;
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .terminal-container {
        width: 95%;
        height: 80vh;
    }
    
    .terminal-screen {
        padding: 20px;
    }
    
    .terminal-content {
        font-size: 14px;
    }
    
    .terminal-header {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .terminal-content {
        font-size: 12px;
        line-height: 1.6;
    }
    
    .terminal-screen {
        padding: 15px;
    }
}