/* KAPLEY.COM - C64 BASIC V2 startup screen */

:root {
    --c64-blue-bg: #3d3aaf;
    --c64-blue-fg: #a1a0ff;
}

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

html, body {
    height: 100%;
    width: 100%;
    background: #000;
    overflow: hidden;
    font-family: 'IBM Plex Mono', 'JetBrains Mono', 'Courier New', monospace;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: pixelated;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c64-blue-fg);
    padding: 0;
}

.noscript-fallback {
    position: fixed;
    inset: 0;
    background: var(--c64-blue-bg);
    color: var(--c64-blue-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 9999;
}

/* The light-blue outer border zone (the C64 plastic border around the inner screen) */
.c64-frame {
    width: 100%;
    height: 100%;
    background: var(--c64-blue-fg);
    padding: 30px;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

/* The dark-blue inner CRT screen */
.c64-screen {
    flex: 1;
    background: var(--c64-blue-bg);
    color: var(--c64-blue-fg);
    padding: 1rem 1.25rem;
    overflow-y: auto;
    overflow-x: hidden;
    text-transform: uppercase;
    font-size: 1.15rem;
    line-height: 1.25;
    letter-spacing: 0.04em;
    outline: none;
    cursor: text;
    white-space: pre-wrap;
    word-break: break-word;
    /* Subtle scanline-ish feel without being noisy */
    text-shadow: 0 0 1px rgba(161, 160, 255, 0.35);
}

.c64-screen::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.c64-output {
    white-space: pre-wrap;
    word-break: break-word;
}

.c64-output .line {
    display: block;
    min-height: 1.25em;
    white-space: pre-wrap;
    word-break: break-word;
}

.c64-prompt-line {
    display: inline;
    white-space: pre-wrap;
    word-break: break-word;
}

.c64-input {
    white-space: pre-wrap;
    word-break: break-word;
}

.c64-cursor {
    display: inline-block;
    color: var(--c64-blue-fg);
    line-height: 1;
    transform: translateY(0);
}

.c64-cursor.blink-off {
    visibility: hidden;
}

/* Iframe container for GAMES */
.games-frame {
    display: block;
    width: 100%;
    height: 70vh;
    border: 2px solid var(--c64-blue-fg);
    margin: 0.5rem 0;
    background: #000;
}

/* SSH stderr lines render in a softer red on the C64 blue. The font and
   styling otherwise match the rest of the screen. */
.c64-output .line.ssh-stderr {
    color: #ff7d7d;
    text-shadow: 0 0 1px rgba(255, 125, 125, 0.35);
}

/* The hidden mobile input - sits offscreen but receives focus on touch devices
   so iOS / Android keyboards pop up. We render the typed value back into the
   visible prompt line via JS. */
#mobileInput {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    background: transparent;
    color: transparent;
}

/* Mobile sizing */
@media (max-width: 720px) {
    .c64-frame {
        padding: 14px;
    }
    .c64-screen {
        font-size: 0.95rem;
        padding: 0.75rem 0.85rem;
    }
}

@media (max-width: 420px) {
    .c64-frame {
        padding: 8px;
    }
    .c64-screen {
        font-size: 0.82rem;
        padding: 0.6rem 0.7rem;
    }
}

@media (max-height: 500px) {
    .c64-screen {
        font-size: 0.9rem;
    }
}
