* { margin:0; padding:0; box-sizing:border-box; }
body {
    background: #000;
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    height: 100dvh;
    touch-action: manipulation;
}
canvas { position: fixed; top: 0; left: 0; z-index: -1; opacity: 0.18; }

#flash {
    position: fixed;
    inset: 0;
    background: #ff0022;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.15s;
}

.container {
    position: relative;
    z-index: 2;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.header {
    font-size: clamp(1.7rem, 7.5vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 0 15px #00ff00;
    animation: glitch 4s infinite;
    position: relative;
}
.header:hover { animation: glitch 0.3s infinite; }

.subheader {
    font-size: clamp(0.95rem, 4vw, 1.3rem);
    margin-bottom: 18px;
    opacity: 0.9;
    text-shadow: 0 0 10px #00ff00;
}

#terminal {
    position: relative;
    background: rgba(0,20,0,0.95);
    border: 3px solid #00ff00;
    width: 98%;
    max-width: 860px;
    height: min(560px, 90dvh);
    overflow: hidden;
    box-shadow: 0 0 80px #00ff00, inset 0 0 100px rgba(0,255,0,0.25);
    border-radius: 6px;
    padding-top: 36px;
    animation: pulse-glow 3s ease-in-out infinite alternate;
}

#terminal::before {
    content: "NYX-TERMINAL // SECURE TUNNEL ACTIVE";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 36px;
    background: #000d00;
    border-bottom: 2px solid #00ff00;
    color: #00ff41;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
    z-index: 5;
    text-shadow: 0 0 12px #00ff00;
}

#terminal::after {
    content: "● LIVE";
    position: absolute;
    top: 11px;
    right: 18px;
    color: #ff0044;
    font-size: 0.75rem;
    animation: live-blink 1.2s step-end infinite;
    text-shadow: 0 0 10px #ff0044;
}

#terminal .title-buttons {
    position: absolute;
    top: 11px;
    left: 14px;
    display: flex;
    gap: 8px;
}
#terminal .title-buttons span {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow: 0 0 6px #ff5f57;
}
#terminal .title-buttons span:nth-child(2) { background: #ffbc2e; box-shadow: 0 0 6px #ffbc2e; }
#terminal .title-buttons span:nth-child(3) { background: #28c840; box-shadow: 0 0 6px #28c840; }

#output {
    height: calc(100% - 90px);
    overflow-y: auto;
    padding: 18px 50px;
    font-size: clamp(1rem, 3.6vw, 1.3rem);
    line-height: 1.45;
}

.prompt {
    display: flex;
    padding: 14px 50px;
    font-size: clamp(1.05rem, 3.8vw, 1.3rem);
    background: #001100;
    border-top: 2px solid #00ff00;
}

#input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.05rem, 3.8vw, 1.3rem);
    flex: 1;
    outline: none;
    padding-left: 8px;
}

.line { margin-bottom: 7px; }

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    #terminal {
        width: 100%;
        height: 94dvh;
        border-radius: 0;
        border: 2px solid #00ff00;
        padding-top: 34px;
    }
    #output { padding: 14px 22px; }
    .prompt { padding: 12px 22px; font-size: 1.2rem; }
    #terminal::before { font-size: 0.78rem; letter-spacing: 1px; }
}

/* ANIMATIONS */
@keyframes pulse-glow { 0% { box-shadow: 0 0 80px #00ff00, inset 0 0 100px rgba(0,255,0,0.25); } 100% { box-shadow: 0 0 120px #00ff00, inset 0 0 150px rgba(0,255,0,0.4); } }
@keyframes live-blink { 50% { opacity: 0.2; } }
@keyframes glitch {
    0%   { text-shadow: 2px 0 #ff00ff, -2px 0 #00ffff; }
    5%   { text-shadow: -2px 0 #ff00ff, 2px 0 #00ffff; }
    10%  { text-shadow: 3px 0 #00ff00; }
    15%  { text-shadow: -3px 0 #00ffff; }
    20%  { text-shadow: 2px 2px #ff00ff; }
    100% { text-shadow: 2px 0 #ff00ff, -2px 0 #00ffff; }
}
