html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #6C5EB5;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Both canvases are tiny bitmaps blown up: nearest-neighbour, never smoothed.
   crisp-edges is the older Firefox spelling; pixelated wins where known. */
#c64-border,
#c64-screen {
    position: fixed;
    display: block;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

#c64-border {
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
}

/* Size and position are set by fit(). */
#c64-screen {
    left: 0;
    top: 0;
}

/* The VIC-II blanks the screen while the tape is read: border colour only. */
body.c64-blank #c64-screen {
    visibility: hidden;
}


/* ---------- hint ---------- */

#c64-hint {
    position: fixed;
    left: 50%;
    top: 34px;
    transform: translateX(-50%);
    z-index: 4;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: clamp(15px, 4vw, 20px);
    line-height: 1.5;
    text-align: center;
    color: #FFFFFF;
    background: rgba(0, 0, 0, 0.72);
    border-radius: 14px;
    padding: 18px 28px 22px;
    box-sizing: border-box;
    width: max-content;
    max-width: min(92vw, 30em);
    overflow: hidden;

    transition: opacity 0.6s ease;
}

#c64-hint kbd {
    font-family: inherit;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* Countdown to the hint going away: drains over HINT_TIMEOUT_MS, which the
   JS hands over as --hint-ms. */
#c64-hint::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    box-sizing: content-box;
    height: 5px;
    background: #FFFFFF;
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
    transform-origin: left center;
    animation: c64-hint-countdown var(--hint-ms, 8s) linear forwards;
}

@keyframes c64-hint-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

#c64-hint.c64-hint-gone {
    opacity: 0;
    pointer-events: none;
}
