body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.terminal-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@font-face {
    font-family: 'Cellblock';
    src: url('../fonts/cellblocknbp.otf') format('opentype');
}

@font-face {
    font-family: 'Exo2';
    src: url('../fonts/exo2_0_regular.otf') format('opentype');
}

.terminal {
    position: relative;
    width: 900px;
    max-height: 90vh;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(200, 220, 255, 0.6);
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(200, 220, 255, 0.2);
    backdrop-filter: blur(5px);
    font-family: 'Courier New', monospace;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    z-index: 1;
    transition: transform 0.1s ease, filter 0.1s ease;
}

.terminal.glitch {
    animation: glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitch {
    0% { transform: translate(-50%, -50%); filter: none; clip-path: inset(0 0 0 0); }
    5% { transform: translate(-51.2%, -48.7%) skewX(4.5deg) skewY(2deg); filter: hue-rotate(130deg) saturate(1.8); clip-path: inset(10% 0 80% 0); }
    10% { transform: translate(-48.9%, -51.3%) skewX(-3.8deg) skewY(-1.5deg); filter: hue-rotate(280deg) brightness(0.7) contrast(1.4); clip-path: inset(60% 0 5% 0); }
    15% { transform: translate(-50.7%, -50.1%) skewX(2.3deg); filter: hue-rotate(50deg) brightness(1.3); clip-path: inset(0 15% 0 85%); }
    20% { transform: translate(-49.3%, -49.4%) skewX(-5.1deg) scaleY(1.05); filter: hue-rotate(320deg) saturate(0.5) contrast(1.6); clip-path: inset(25% 0 50% 0); }
    25% { transform: translate(-50.4%, -50.6%) skewX(1.7deg) skewY(-3deg); filter: hue-rotate(190deg) brightness(0.9); clip-path: inset(0 0 30% 70%); }
    30% { transform: translate(-49.6%, -49.8%) skewX(-2.9deg); filter: hue-rotate(410deg) contrast(1.2) brightness(1.1); clip-path: inset(40% 60% 0 0); }
    35% { transform: translate(-50.8%, -50.2%) skewX(3.4deg) skewY(1.8deg); filter: hue-rotate(70deg) saturate(2); clip-path: inset(0 25% 60% 0); }
    40% { transform: translate(-49.1%, -50.9%) skewX(-4.2deg) scaleX(1.03); filter: hue-rotate(550deg) brightness(0.6) contrast(1.8); clip-path: inset(70% 0 10% 0); }
    45% { transform: translate(-50.5%, -49.5%) skewX(2.8deg) skewY(-2.5deg); filter: hue-rotate(230deg) saturate(0.7); clip-path: inset(0 0 0 40%); }
    50% { transform: translate(-49.4%, -50.4%) skewX(-3.5deg) scaleY(0.97); filter: blur(1.5px) contrast(1.5) invert(0.2); clip-path: inset(15% 40% 20% 30%); }
    55% { transform: translate(-50.9%, -49.1%) skewX(4.1deg); filter: hue-rotate(360deg) brightness(1.4); clip-path: inset(0 70% 25% 0); }
    60% { transform: translate(-49.2%, -50.7%) skewX(-2.2deg) skewY(3.2deg); filter: hue-rotate(95deg) saturate(1.5) contrast(0.9); clip-path: inset(50% 0 0 60%); }
    65% { transform: translate(-50.6%, -49.3%) skewX(3.9deg); filter: hue-rotate(480deg) brightness(0.8); clip-path: inset(20% 10% 55% 0); }
    70% { transform: translate(-49.7%, -50.8%) skewX(-4.8deg) scaleX(0.98); filter: hue-rotate(610deg) contrast(1.7); clip-path: inset(0 0 45% 25%); }
    75% { transform: translate(-50.3%, -49.6%) skewX(2.1deg) skewY(-1.2deg); filter: hue-rotate(155deg) saturate(0.4) brightness(1.2); clip-path: inset(35% 50% 0 0); }
    80% { transform: translate(-49.8%, -50.1%) skewX(-3.1deg); filter: hue-rotate(720deg) contrast(1.3); clip-path: inset(0 45% 0 55%); }
    85% { transform: translate(-50.1%, -49.9%) skewX(1.4deg) skewY(2.7deg); filter: hue-rotate(290deg) brightness(0.95); clip-path: inset(65% 0 15% 20%); }
    90% { transform: translate(-49.5%, -50.2%) skewX(-2.6deg); filter: hue-rotate(440deg) saturate(1.2); clip-path: inset(10% 65% 0 0); }
    95% { transform: translate(-50.2%, -49.7%) skewX(3.6deg) skewY(-0.8deg); filter: hue-rotate(580deg) contrast(1.1) brightness(1.05); clip-path: inset(0 30% 70% 0); }
    100% { transform: translate(-50%, -50%); filter: none; clip-path: inset(0 0 0 0); }
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.terminal-icon {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 8px rgba(100, 180, 255, 0.8));
}

.terminal h3 {
    margin: 0;
    font-size: 36px;
    color: #ffffff;
    font-family: 'Cellblock', monospace;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(200, 230, 255, 0.3);
}

.terminal-hr {
    width: 70%;
    border: none;
    border-top: 1px solid #ffffff;
    margin: 10px auto;
    opacity: 0.7;
}

.terminal p {
    font-size: 21px;
    line-height: 1.4;
    margin: 10px 0;
    text-align: justify;
    font-family: 'Exo2', monospace;
    color: #ffffff;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.terminal p::-webkit-scrollbar {
    width: 6px;
}

.terminal p::-webkit-scrollbar-track {
    background: transparent;
}

.terminal p::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.terminal p .cursor {
    display: inline-block;
    width: 12px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 1s infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
    color: #ffffff;
    font-family: 'Exo2', monospace;
    font-size: 21px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .terminal {
        width: 95%;
        max-width: 95%;
        padding: 15px;
    }

    .terminal-icon {
        width: 24px;
        height: 24px;
    }

    .terminal h3 {
        font-size: 20px;
    }

    .terminal p {
        font-size: 16px;
        line-height: 1.5;
    }

    .terminal p .cursor {
        width: 10px;
        height: 20px;
    }

    .user-info {
        font-size: 16px;
    }

    .terminal-hr {
        width: 80%;
    }
}
