:root {
    --bg: #4D4D4D;
    --terminal-bg: #151515;
    --terminal-fg: #55FF00;
    --text-glow: 0 0 10px rgba(0, 255, 65, 0.4);
    --font-mono: 'Iosevka Web', monospace;
}

@font-face {
    font-family: 'Iosevka Web';
    font-display: swap;
    font-weight: 400;
    font-stretch: normal;
    font-style: normal;
    src: url('../fonts/Iosevka-Regular.woff2') format('woff2');
}

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

body {
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: var(--font-mono);
    padding: 20px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.terminal {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    max-height: 650px;
    min-height: 420px;
    background: var(--terminal-bg);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 40px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(0, 255, 65, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    position: relative;
}

.output-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 8px 18px;
    color: var(--terminal-fg);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.55;
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
    white-space: pre-wrap;
    word-break: break-all;
    -webkit-overflow-scrolling: touch;
}

.output-line {
    text-shadow: var(--text-glow);
    animation: fadeInLine 0.15s ease-out;
    min-height: 1.4em;
}

/* Animation for output lines */
@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-area {
    display: flex;
    align-items: center;
    padding: 6px 18px 14px 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    gap: 0;
}

.prompt {
    color: var(--terminal-fg);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.55;
    text-shadow: var(--text-glow);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    white-space-collapse: preserve-spaces;
    -webkit-user-select: none;
}

.input-area input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-fg);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.55;
    caret-color: var(--terminal-fg);
    text-shadow: var(--text-glow);
    padding: 0;
    margin: 0;
    min-width: 20px;
    letter-spacing: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input-area input::selection {
    background: var(--terminal-fg);
    color: var(--terminal-bg);
}

/* For Mobile Devices */
@media (max-width: 768px) {
    .terminal {
        height: 90vh;
        max-height: none;
        min-height: 350px;
        border-radius: 6px;
        margin: 0;
    }
    .output-area {
        padding: 12px 12px 6px 12px;
        font-size: 0.82rem;
        line-height: 1.5;
    }
    .input-area {
        padding: 4px 12px 10px 12px;
    }
    .input-area input,
    .prompt {
        font-size: 0.82rem;
        line-height: 1.5;
    }
}

@media (max-width: 400px) {
    body {
        padding: 8px;
    }
    .terminal {
        height: 92vh;
        min-height: 300px;
        border-radius: 4px;
    }
    .output-area {
        padding: 10px 10px 4px 10px;
        font-size: 0.75rem;
        line-height: 1.45;
    }
    .input-area {
        padding: 3px 10px 8px 10px;
    }
    .input-area input,
    .prompt {
        font-size: 0.75rem;
        line-height: 1.45;
    }
}
