:root {
    --ibm-blue: #0000AA;
    --ibm-white: #AAAAAA;
    --ibm-bright-white: #FFFFFF;
}

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
}

.crt-monitor {
    width: 95%; /* More width for mobile */
    max-width: 900px;
    background: #333;
    padding: 10px; /* Reduced padding for mobile */
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

.screen {
    background-color: var(--ibm-blue);
    /* Use 60vh so it scales with the phone's height */
    height: 60vh; 
    min-height: 250px; 
    position: relative;
    overflow-y: auto;
    border: 8px solid #222;
    border-radius: 10px;
    padding: 15px;
    color: var(--ibm-white);
    /* This makes the screen tap-able to focus the keyboard */
    cursor: text;
}

/* Scanlines and CRT Bulge */
.scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.typing-area {
    font-size: 1.5rem;
    margin-top: 40px;
    min-height: 100px;
    color: var(--ibm-bright-white);
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.print-log {
    margin-top: 30px;
    border-top: 2px dashed var(--ibm-white);
    padding-top: 10px;
    font-size: 0.9rem;
    color: #888;
}

button {
    background: var(--ibm-white);
    border: none;
    padding: 10px 20px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    margin-right: 10px;
}

button:hover { background: var(--ibm-bright-white); }

footer {
    text-align: center;
    color: #777;
    margin-top: 15px;
    font-size: 0.8rem;
}

.print-entry {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    margin-bottom: 10px;
    border-left: 5px solid var(--ibm-bright-white);
    font-size: 0.85rem;
    white-space: pre-wrap; /* Keeps your "Enter" line breaks visible in the log */
}

/* Hide header on very small horizontal screens to save space */
@media (max-height: 400px) {
    header { font-size: 0.7rem; }
    .typing-area { margin-top: 10px; font-size: 1.1rem; }
}