@font-face {
    font-family: 'C64_Pro_Mono';
    src: url('./Fonts/C64_Pro_Mono-STYLE.ttf') format('truetype');
}

/* Reset and Basics */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styling */
body {
    background-color: #7C71DB; /* Outer border color */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    font-family: 'C64_Pro_Mono', monospace; /* Retro font */
}

/* Screen Styling */
.screen {
    background-color: #3E32A2; /* Inner screen color */
    width: calc(100% - 120px); /* Adjust for 60px padding on both sides */
    height: calc(100% - 120px); /* Adjust for 60px padding on top and bottom */
    padding: 20px;
    color: #fff; /* Default text color */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 5px solid #7C71DB; /* Outer border for the screen */
    overflow-y: auto; /* Scroll when output fills the screen */
    scrollbar-width: none; /* Keep the retro look clean */
    scrollbar-color: transparent transparent;
}

/* Boot Text Styling */
.boot-text {
    font-family: 'C64_Pro_Mono', monospace; /* Ensure C64 boot text uses the retro font */
    font-size: 2rem; /* Font size closer to C64 */
    line-height: 1.5; /* Adjust line spacing */
    text-align: center; /* Center-align the boot text */
    white-space: pre-wrap; /* Allows line breaks to wrap */
    color: #7C71DB; /* Match the border color */
}

.boot-text .title-line {
    margin-bottom: 10px; /* Add spacing below the first line */
}

/* Input Area Styling */
.input-area {
    margin-top: 20px; /* Space between boot text and input area */
}

/* READY Line Styling */
.ready-line {
    font-family: 'C64_Pro_Mono', monospace; /* Ensure consistent font */
    font-size: 2rem; /* Match the boot text size */
    line-height: 1; /* Match line spacing */
    color: #7C71DB; /* Matches the text color */
    text-align: left; /* Left-align READY. */
    margin-left: 20px; /* Indent READY. */
}

/* Cursor Line Styling */
.cursor-line {
    font-family: 'C64_Pro_Mono', monospace; /* Ensure consistent font */
    font-size: 2rem; /* Match the text size */
    text-align: left; /* Align cursor beneath READY. */
    color: #7C71DB; /* Matches the text color */
    margin-left: 20px; /* Indent cursor under "READY." */
    display: inline;
}

/* Cursor Styling */
.cursor {
    font-family: 'C64_Pro_Mono', monospace; /* Consistent with screen text */
    font-size: 2rem; /* Same size as text for a block cursor */
    animation: blink 1s step-end infinite; /* Add blinking effect */
    color: #7C71DB; /* Matches the text color */
}

.easter-egg {
    font-family: 'C64_Pro_Mono', monospace; /* Consistent font */
    font-size: 2rem; /* Match the boot text size */
    line-height: 1; /* Match line spacing */
    color: #7C71DB; /* Custom Easter egg color */
    margin-left: 20px; /* Align with other lines */
}

.easter-egg a {
    color: #c9d487; /* Link color matches Easter egg text */
    text-decoration: none; /* Remove underline for retro look */
}

.easter-egg a:hover {
    text-decoration: underline; /* Add underline on hover for clarity */
}

.inverse {
    background-color: #7C71DB; /* Outer border color */
    color: #FFFFFF; /* Inverted text color */
    padding: 2px 4px; /* Add padding for better visibility */
    border-radius: 2px; /* Optional: rounded corners */
    font-weight: bold; /* Make the text bold for emphasis */
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}


/* GEOS uses a fixed 320 x 200 bitmap; scale it without smoothing. */
body.geos-active { background: #202020 !important; overflow: hidden; }
body.geos-active > .screen { display: none; }
.geos-shell { position: fixed; inset: 0; display: grid; place-items: center; background: #202020; z-index: 100; }
.geos-shell[hidden] { display: none; }
.geos-monitor { padding: calc(12px * var(--geos-scale, 2)); background: #aaa; }
.geos-desktop { position: relative; width: 320px; height: 200px; transform: scale(var(--geos-scale, 2)); transform-origin: top left; font-family: monospace; }
.geos-viewport { width: calc(320px * var(--geos-scale, 2)); height: calc(200px * var(--geos-scale, 2)); }
.geos-desktop canvas { position: absolute; inset: 0; width: 320px; height: 200px; image-rendering: pixelated; }
.geos-controls { position: absolute; inset: 0; }
.geos-control { position: absolute; border: 0; border-radius: 0; background: transparent; color: transparent; padding: 0; margin: 0; cursor: inherit; touch-action: manipulation; }
.geos-control:focus-visible { outline: 1px dashed #000; outline-offset: -2px; background: #0001; }
.geos-desktop, .geos-control { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='20' viewBox='0 0 16 20'%3E%3Cpath d='M1 1v15l4-4 3 7 3-1-3-7h6z' fill='white' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") 1 1, default; }
.geos-editor { position: absolute; border: 1px solid #111; border-radius: 0; background: #eee; color: #111; font: 8px/11px monospace; padding: 3px; resize: none; outline-offset: 1px; }
.geos-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .geos-shell * { animation: none; } }

.geos-desktop:focus { outline: none; }
.geos-paint-surface { position: absolute; left: 32px; top: 52px; width: 256px; height: 112px; touch-action: none; cursor: crosshair; }
.geos-paint-surface:focus-visible { outline: 1px dashed #111; outline-offset: 1px; }
.geos-rich-document { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; font: 10px/1.3 Arial, sans-serif; cursor: text; user-select: text; }
.geos-rich-document .geos-inline-picture { position: static; inset: auto; display: block; width: auto; height: auto; max-width: 100%; margin: 4px 0; image-rendering: pixelated; }
.geos-paragraph { margin-top: 0; margin-bottom: 0; min-height: 1em; }
.geos-tab { display: inline-block; overflow: hidden; white-space: pre; vertical-align: baseline; color: transparent; }

/* Keep solid, readable glyphs when text strokes are unavailable. */
@supports (-webkit-text-stroke: 1px black) {
    .geos-rich-document .geos-outline { -webkit-text-stroke: 0.08em currentColor; -webkit-text-fill-color: var(--geos-outline-fill); }
    .geos-rich-document .geos-outline::selection { -webkit-text-stroke: 0; -webkit-text-fill-color: HighlightText; }
}

.geos-page-header { box-sizing: content-box; border-bottom: 1px dotted #111; padding-bottom: 4px; margin-bottom: 6px; }
.geos-page-footer { box-sizing: content-box; border-top: 1px dotted #111; padding-top: 4px; margin-top: 6px; }

.geos-page-spacer { height: 0; margin: 0; padding: 0; border: 0; }

/* Fixed 4:3 monitor and touch controls; desktop retains its original layout. */
@media (max-width: 767px), (pointer: coarse) and (max-height: 600px) {
    body:not(.geos-active) {
        height: auto;
        min-height: 100svh;
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        padding: 12px 12px max(12px, env(safe-area-inset-bottom));
        gap: 12px;
    }
    .mobile-monitor { position: relative; flex: none; overflow: hidden; }
    .mobile-monitor > .screen {
        position: absolute;
        inset: 0 auto auto 0;
        width: 1280px;
        height: 960px;
        border-width: 64px;
        padding: 16px;
        transform: scale(var(--mobile-scale));
        transform-origin: top left;
        overscroll-behavior: contain;
    }
    .mobile-monitor .boot-text,
    .mobile-monitor .ready-line,
    .mobile-monitor .cursor-line,
    .mobile-monitor .cursor,
    .mobile-monitor .easter-egg {
        font-size: 28px;
        line-height: 1.4;
        margin-left: 0;
    }
    .mobile-monitor .boot-text { white-space: pre; }
    .mobile-monitor .ready-line { white-space: pre-wrap; overflow-wrap: anywhere; }
    .mobile-monitor .cursor-line { white-space: normal; overflow-wrap: anywhere; }
    .mobile-monitor .cursor-line > span { white-space: pre-wrap; }
    .mobile-controls {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        width: min(100%, 480px);
        flex: none;
    }
    .mobile-controls button {
        min-height: 44px;
        border: 2px solid #3e32a2;
        border-radius: 5px;
        background: #d7d1f2;
        color: #24196d;
        box-shadow: 0 3px 0 #3e32a2;
        font: bold 12px/1.2 monospace;
        touch-action: manipulation;
    }
    .mobile-controls button:active { transform: translateY(2px); box-shadow: 0 1px 0 #3e32a2; }
    .mobile-controls button:focus-visible { outline: 2px solid white; outline-offset: 2px; }
    .mobile-hint { max-width: 100%; color: #24196d; font: 12px/1.5 monospace; text-align: center; }
    body.geos-active > .mobile-monitor,
    body.geos-active > .mobile-controls,
    body.geos-active > .mobile-hint { display: none; }
}
