body {
    background-color: black;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    /* Add padding to the bottom to prevent the last line from being hidden by the input */
    padding-bottom: 60px; 
}

#terminal-output {
    padding: 30px;
}

.matrix-text {
    color: #00FF41; /* A bright "Matrix" green */
    font-size: 24px;
    text-shadow: 0 0 8px #00FF41;
    margin: 0 0 10px 0; /* Adds some space between lines */
    word-wrap: break-word; /* Prevents long text from overflowing */
}

/* New styles for the input form */
#command-form {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

#command-input {
    width: 100%;
    background-color: transparent;
    border: none;
    color: #00FF41;
    padding: 15px 30px;
    font-size: 24px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 8px #00FF41;
    box-sizing: border-box; /* Ensures padding is included in the width */
}

#command-input:focus {
    outline: none; /* Removes the default blue/orange border on click */
}

/* Keep the output area scrollable without fighting the fixed input */
html, body { height: 100%; }
#terminal-output {
  white-space: pre-wrap;          /* preserves newlines from JS blocks */
  overflow-y: auto;               /* independent scrolling if content is huge */
  max-height: calc(100vh - 60px); /* matches your body padding-bottom */
  scroll-behavior: smooth;
}

/* Make the fixed input bar sit on a subtle backdrop and avoid overlap issues */
#command-form {
  background: linear-gradient(to top, rgba(0,0,0,0.92), rgba(0,0,0,0));
  border-top: 1px solid rgba(0, 255, 65, 0.2);
  padding-bottom: env(safe-area-inset-bottom, 0); /* iPhone safe area */
}

/* Caret and selection feel a bit more “terminal” */
#command-input { caret-color: #00FF41; }
::selection { background: rgba(0, 255, 65, 0.25); color: #00FF41; }

/* Respect users who prefer less motion (typewriter still runs, but page scrolling won’t animate) */
@media (prefers-reduced-motion: reduce) {
  #terminal-output { scroll-behavior: auto; }
}
