body {
    position: relative;
    background: #474747;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    margin: 0;
    font-family: 'Courier New', monospace;
}

.terminal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    transition: opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
    animation:  crtPowerOn 1.5s ease-in forwards;
    z-index: 90;
}

.terminal-blackout {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    pointer-events: none;
    z-index: 80;
    animation: fadeaway 3s forwards;
}

.terminal-mask {
    top: 2dvh;
    left: 2dvh;
    right: 2dvh;
    background: #00000000;
    border-radius: 20px;
    box-shadow: 
        inset 0 0 100px rgba(0,255,0,0.2),
        0 0 0 3px #333,
        /*0 0 10px rgba(51, 255, 51, 0.3),*/
        0 0 0px 1000px rgb(20, 20, 20);
    padding: clamp(1rem, 2vw, 2rem);
    height: 75dvw;
    max-height: 95dvh;
    box-sizing: border-box;
    position: absolute;
    margin: auto;
    pointer-events: none;
    z-index: 99999;
}

.terminal {
    &::-webkit-scrollbar {display: none;}
    -ms-overflow-style: none;
    scrollbar-width: none;
    top: 2dvh;
    left: 2dvh;
    right: 2dvh;
    background: #0C0C0C;
    padding: clamp(1rem, 2vw, 2rem);
    height: 75dvw;
    max-height: 95dvh;
    box-sizing: border-box;
    position: absolute;
    margin: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.terminal-text {
    color: #33ff33;
    outline: none;
    font-size: 24px;
    line-height: 1.5;
    white-space: pre-wrap;
    text-shadow: 0 0 5px #33ff33;
    position: relative;
    animation: textflicker 7s infinite;
}

.terminal-scan {
    background: rgba(0, 181, 3, 0.09);
    border-radius: 10px;
    width: 100%;
    left: 0;
    backdrop-filter: hue-rotate(20deg) blur(.1px);
    -webkit-backdrop-filter: hue-rotate(20deg) blur(.1px);
    padding: 10dvw;
    position: fixed;
    pointer-events: none;
    z-index: 199;
    animation: scanY 20s infinite linear;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 45%,
        black 55%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 45%,
        black 55%,
        transparent 100%
    );
}

.terminal-scan2 {
    background: rgba(0, 181, 3, 0.07);
    border-radius: 10px;
    width: 100%;
    left: 0;
    backdrop-filter: hue-rotate(20deg) blur(.1px);
    -webkit-backdrop-filter: hue-rotate(20deg) blur(.1px);
    padding: 10dvw;
    position: fixed;
    pointer-events: none;
    z-index: 200;
    animation: scanY 16s infinite linear;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 45%,
        black 55%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 45%,
        black 55%,
        transparent 100%
    );
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
}

.underscore {
    position: absolute;
    animation: blink .7s ease-in-out infinite;
    width: 0;
    overflow: visible;
    display: inline-block;
}

@keyframes glow {
    0% { text-shadow: 0 0 8px #33ff33; opacity: 0.1; }
    50% { text-shadow: 0 0 12px #33ff33; opacity: 0.7; }
    100% { text-shadow: 0 0 5px #33ff33; opacity: 1; }
}

@keyframes textflicker {
    0% { opacity: 1; }
    30% { opacity: 1; }
    31% { opacity: 0.9; }
    32% { opacity: 1; }
    97% { opacity: 1; }
    98% { opacity: 0.8; }
    100% { opacity: 1; }
}

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

@keyframes fadeaway {
    0% { opacity: 1; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes crtPowerOn {
    0% {
    opacity: 1;
    transform: scale(0.2, 0.01);
    background: #33ff33;
    }
    10% {
    opacity: 1;
    transform: scale(.6, 0.1);
    background: #33ff33;
    }
    20% {
    opacity: 1;
    transform: scale(1, 0.1);
    background: #26c026;
    }
    30% {
    opacity: 1;
    transform: scale(1, 0.2);
    background: #1fa31f;
    }
    40% {
    opacity: 1;
    transform: scale(1, 1);
    background: #1fa31f;
    }
    100% {
    opacity: 0;
    transform: scale(1, 1);
    background: #125a12;
    pointer-events: none;
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 1024px) {

    .terminal-text {
        font-size: 20px;
        line-height: 1.4;
    }
}

@media screen and (max-width: 768px) {

    .terminal-text {
        font-size: 14px;
        line-height: 1.4;
    }
}

@media screen and (max-width: 480px) {

    .terminal-text {
        font-size: 12px;
        line-height: 1.3;
    }
}

@keyframes scanY {
    0% {
        transform: translateY(-20dvw);
    }
    100% {
        transform: translateY(70dvw);
    }
}