:root {
    --bg-color: #050505;
    --text-color: #00ff41; /* Classic Matrix Green */
    --text-dim: #008f11;
    --alert-color: #ff003c;
    --font-family: 'VT323', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 24px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CRT Effects */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 100;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.25) 51%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 99;
}

.terminal {
    width: 90vw;
    max-width: 1000px;
    height: 90vh;
    padding: 2rem;
    position: relative;
    border: 1px solid var(--text-dim);
    box-shadow: 0 0 10px var(--text-dim), inset 0 0 15px rgba(0, 255, 65, 0.1);
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px dashed var(--text-dim);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 5px var(--text-color);
}

.terminal-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.line {
    word-break: break-all;
    text-shadow: 0 0 3px var(--text-color);
}

.prompt {
    color: var(--text-dim);
    margin-right: 0.5rem;
}

.success {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.hidden {
    display: none;
}

/* Interactive Menu */
.menu {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.interactive-option {
    display: inline-block;
    width: fit-content;
    padding: 0.2rem 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.interactive-option:hover {
    border: 1px solid var(--text-color);
    background-color: var(--text-color);
    color: var(--bg-color);
    text-shadow: none;
    box-shadow: 0 0 10px var(--text-color);
}

/* Info Panel */
.info-panel {
    margin-top: 2rem;
    flex-grow: 1;
}

.border-box {
    border: 1px solid var(--text-color);
    padding: 1rem;
    position: relative;
    height: 100%;
}

.box-title {
    position: absolute;
    top: -15px;
    left: 20px;
    background-color: var(--bg-color);
    padding: 0 10px;
}

#dynamic-content {
    margin-top: 1rem;
    white-space: pre-wrap;
    font-size: 1.2rem;
    line-height: 1.5;
}

/* Cursor Blink */
.cursor-blink {
    animation: blink 1s step-end infinite;
}

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

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--alert-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--text-dim);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 44px, 0); }
    20% { clip: rect(85px, 9999px, 9px, 0); }
    40% { clip: rect(66px, 9999px, 54px, 0); }
    60% { clip: rect(11px, 9999px, 78px, 0); }
    80% { clip: rect(98px, 9999px, 21px, 0); }
    100% { clip: rect(43px, 9999px, 88px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(2px, 9999px, 33px, 0); }
    40% { clip: rect(55px, 9999px, 66px, 0); }
    60% { clip: rect(89px, 9999px, 12px, 0); }
    80% { clip: rect(22px, 9999px, 77px, 0); }
    100% { clip: rect(1px, 9999px, 44px, 0); }
}

/* Noise overlay */
.terminal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="1.5" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.05;
    pointer-events: none;
}
