:root {
    --phosphor: #16c60c;
    --bg-color: #000000;

    --crt-red: rgb(218, 49, 49);
    --crt-green: rgb(112, 159, 115);
    --crt-blue: rgb(40, 129, 206);
}

/* Global */
html {
    font-size: 1.5rem;
    font-family: "Courier New", monospace;
    min-height: 100%;
}

main {
    height: 100vh;
    height: 100dvh;
    color: rgba(255, 255, 255, 0.75);
}

body {
    background-color: rgb(25, 25, 30);
    /* New background color */
    color: var(--phosphor);
    font-family: 'VT323', monospace;
    font-size: 24px;
    margin: 0;
    overflow: hidden;
    text-shadow: 0 0 0.2em currentColor, 1px 1px rgba(255, 0, 255, 0.5),
        -1px -1px rgba(0, 255, 255, 0.4);
}

body::before,
body::after {
    content: "";
    transform: translateZ(0);
    pointer-events: none;
    mix-blend-mode: overlay;
    position: absolute;
    height: 100vh;
    width: 100vw;
    left: 0;
    top: 0;
    z-index: 50;
}

body::before {
    background: repeating-linear-gradient(var(--crt-red) 0px,
            var(--crt-green) 2px,
            var(--crt-blue) 4px);
}

body::after {
    background: repeating-linear-gradient(90deg,
            var(--crt-red) 1px,
            var(--crt-green) 2px,
            var(--crt-blue) 3px);
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom,
            rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 8px;
    z-index: 100;
    pointer-events: none;
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 99;
    background: linear-gradient(0deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(255, 255, 255, 0.2) 10%,
            rgba(0, 0, 0, 0.1) 100%);
    opacity: 0.1;
    position: fixed;
    bottom: 100%;
    animation: scanline 10s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% {
        bottom: 100%;
    }

    80% {
        bottom: 100%;
    }

    100% {
        bottom: 0%;
    }
}

.terminal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 40px;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Keep this for child absolute positioning */
}

.grid-container {
    display: flex;
    gap: 150px;
    justify-content: center;
}

.column {
    display: flex;
    flex-direction: column;
    font-size: 24px;
}

.hex-addr {
    display: inline-block;
    width: 2.5em;
}

.word:hover {
    background-color: var(--phosphor);
    color: var(--bg-color);
    cursor: pointer;
}

.special:hover {
    background-color: var(--phosphor);
    color: var(--bg-color);
    cursor: pointer;
}

.word.removed {
    color: var(--phosphor);
    opacity: 0.3;
    pointer-events: none;
}

/* Other utility classes from your provided CSS */
.pink {
    color: pink;
}

.yellow {
    color: yellow;
}

.lightblue {
    color: lightblue;
}

.code {
    /* This assumes a specific HTML structure not currently present */
    color: attr(data-color);
    animation: typewriter 1s steps(14) 1s 1 normal both;
    line-height: 1;
    margin: 0;
    display: inline-block;
    white-space: nowrap;
    overflow-x: hidden;
}

.cursor {
    /* This assumes a specific HTML structure not currently present */
    display: inline-block;
    animation: blinkTextCursor 500ms infinite normal;
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkTextCursor {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- End Screen Styles --- */
#end-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

#end-screen.hidden {
    display: none;
}

#end-typewriter {
    position: absolute;
    top: 40px;
    left: 40px;
    font-size: 24px;
}

#end-center-text {
    font-size: 64px;
    text-align: center;
    animation: blinkTextCursor 2s infinite normal;
    opacity: 0;
}

#end-center-text.visible {
    opacity: 1;
}

#end-restart-prompt {
    position: absolute;
    bottom: 40px;
    font-size: 24px;
    animation: blinkTextCursor 1s infinite normal;
    cursor: pointer;
}

#end-restart-prompt.hidden {
    display: none;
}

#end-restart-prompt:hover {
    background-color: var(--phosphor);
    color: var(--bg-color);
}

/* Glitch Effect on the main container */
.glitch-effect {
    animation: glitch-anim 0.5s linear infinite;
}

@keyframes glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-5px, 2px); text-shadow: 2px 0 var(--crt-red), -2px 0 var(--crt-blue); }
    40% { transform: translate(-5px, -2px); text-shadow: -2px 0 var(--crt-red), 2px 0 var(--crt-blue); }
    60% { transform: translate(5px, 2px); text-shadow: 2px 0 var(--crt-red), -2px 0 var(--crt-blue); }
    80% { transform: translate(5px, -2px); text-shadow: -2px 0 var(--crt-red), 2px 0 var(--crt-blue); }
    100% { transform: translate(0) }
}