:root {
    --bg-color: #0c0c0c;
    --text-color: #00ff00;
    --prompt-color: #00aaff;
    --error-color: #ff3333;
    --header-bg: #2d2d2d;
    --font-family: 'Fira Code', monospace;
}

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

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

.terminal {
    width: 90vw;
    height: 90vh;
    max-width: 1000px;
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #333;
}

.terminal-header {
    background-color: var(--header-bg);
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #111;
}

.buttons {
    display: flex;
    gap: 8px;
}

.buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.close { background-color: #ff5f56; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #27c93f; }

.title {
    flex-grow: 1;
    text-align: center;
    color: #ccc;
    font-size: 0.9rem;
    font-family: sans-serif;
}

.terminal-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.input-line {
    display: flex;
    padding: 0 20px 20px 20px;
    align-items: center;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 10px;
    white-space: nowrap;
}

#command-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1.1rem;
    flex-grow: 1;
    outline: none;
    caret-color: var(--text-color);
}

.output-line {
    margin-bottom: 8px;
    word-wrap: break-word;
}

.output-line.system {
    color: #ffd700;
}

.output-line.error {
    color: var(--error-color);
}

.output-line.joke {
    color: #ff00ff;
    font-weight: bold;
}

.ascii-art {
    white-space: pre;
    color: var(--prompt-color);
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.glow {
    text-shadow: 0 0 5px var(--text-color);
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design for Mobile Devices */
@media (max-width: 768px) {
    .terminal {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
        border: none;
        box-shadow: none; /* Removed glow effect to improve performance and look more like native full screen on mobile */
    }

    .terminal-body {
        padding: 10px;
        font-size: 1rem; /* Reduced to fit more text, at least 16px to avoid iOS auto-zoom */
    }

    .input-line {
        padding: 0 10px 10px 10px;
    }

    .prompt {
        font-size: 1rem;
    }

    #command-input {
        font-size: 1rem;
    }

    .ascii-art {
        font-size: 0.55rem; /* Resize ASCII art to prevent horizontal scrolling */
        overflow-x: auto;
    }

    /* Adjust the header slightly for mobile */
    .terminal-header {
        padding: 8px;
    }
}
