/* ============================================================
   Monochrome 8-bit / CRT interface
   ============================================================ */

:root {

    --bg: #ffffff;
    --ink: #0a0a0a;

    --pixel-font: 'Press Start 2P', monospace;
    --mono: 'VT323', ui-monospace, 'Courier New', monospace;

}


/* ============================================================
   RESET
   ============================================================ */

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


html,
body {
    width: 100%;
    min-height: 100%;
}


body {

    background: var(--bg);
    color: var(--ink);

    font-family: var(--mono);

    min-height: 100vh;

    display: flex;
    flex-direction: column;

    overflow-x: hidden;

    position: relative;

}


/* ============================================================
   CRT SCANLINES
   ============================================================ */

.scanlines {

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 50;

    background:
        repeating-linear-gradient(
            to bottom,

            rgba(10, 10, 10, 0.045) 0px,
            rgba(10, 10, 10, 0.045) 1px,

            transparent 1px,
            transparent 4px
        );

    mix-blend-mode: multiply;

}


/* ============================================================
   MAIN SCREEN
   ============================================================ */

.screen {

    flex: 1;

    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding: 45px 20px 35px;

    gap: 25px;

}


/* ============================================================
   GAME OVER TITLE
   ============================================================ */

.brand-title {
    display: inline-flex;
    align-items: center;
    gap: 15px;

    /* Important */
    width: fit-content;
    margin: 0 auto;
}

.logo-img-link {
    display: flex;
    align-items: center;

    /* Prevent any old positioning */
    position: static;
    margin: 0;
    padding: 0;
}

.logo-img-link img {
    display: block;

    width: 60px;
    height: 60px;

    object-fit: contain;
}

.title {
    font-family: var(--pixel-font);

    font-size: clamp(
        2rem,
        7vw,
        5rem
    );

    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);

    text-shadow:
        4px 4px 0 var(--ink),
        8px 8px 0 rgba(10, 10, 10, 0.12);

    animation: flicker 4s infinite steps(1);

    /* This is important */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
}

.logo-img-link {
    display: inline-flex;
    align-items: center;
}

.logo-img-link img {
    width: auto;
    height: 5em;
    object-fit: contain;

    display: block;
}

/*
.title {

    font-family: var(--pixel-font);

    font-size: clamp(
        2rem,
        7vw,
        5rem
    );

    font-weight: 400;
    margin: 0;

    line-height: 1.2;

    letter-spacing: 0.04em;

    text-transform: uppercase;

    color: var(--ink);

    /*
     * Hard pixel shadow.
     *//*

    text-shadow:

        4px 4px 0 var(--ink),

        8px 8px 0 rgba(10, 10, 10, 0.12);

    animation: flicker 4s infinite steps(1);

}
*/


/* ============================================================
   TITLE FLICKER
   ============================================================ */

@keyframes flicker {

    0%,
    92%,
    100% {
        opacity: 1;
    }

    93% {
        opacity: .82;
    }

    94% {
        opacity: 1;
    }

    95% {
        opacity: .9;
    }

    96% {
        opacity: 1;
    }

}


/* ============================================================
   COMPUTER
   ============================================================ */

.computer {

    width: min(700px, 94vw);

    display: flex;

    justify-content: center;

}


.computer-svg {

    width: 100%;

    height: auto;

    display: block;

}


/* ============================================================
   SVG PIXEL TYPOGRAPHY
   ============================================================ */

.svg-pixel-text {

    font-family:
        'Press Start 2P',
        monospace;

    font-weight: 400;

    pointer-events: none;

}


.svg-small {

    font-size: 11px;

    letter-spacing: 1px;

}


.svg-button-text {

    font-size: 11px;

    letter-spacing: .5px;

}


/* ============================================================
   SCREEN OPTIONS
   ============================================================ */

.screen-option {

    cursor: pointer;

}


.screen-option rect,
.screen-option text {

    transition:
        fill .08s steps(1),
        stroke .08s steps(1);

}


/* ============================================================
   CONTROL INSTRUCTIONS
   ============================================================ */

.controls {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    flex-wrap: wrap;

    font-family: var(--pixel-font);

    font-size: 10px;

    letter-spacing: .04em;

}


.controls-label {

    margin: 0 3px;

}


.key {

    width: 34px;

    height: 34px;

    border: 3px solid var(--ink);

    display: inline-flex;

    align-items: center;

    justify-content: center;

    font-family: var(--pixel-font);

    font-size: 13px;

    box-shadow: 3px 3px 0 var(--ink);

}


.enter-key {

    border: 3px solid var(--ink);

    padding: 9px 11px;

    font-family: var(--pixel-font);

    font-size: 9px;

    box-shadow: 3px 3px 0 var(--ink);

}


/* ============================================================
   TERMINAL PROMPT
   ============================================================ */

.prompt {

    font-family: var(--pixel-font);

    font-size: 11px;

    letter-spacing: .05em;

}


.cursor {

    animation:
        blink 1s steps(1) infinite;

}


@keyframes blink {

    50% {
        opacity: 0;
    }

}


/* ============================================================
   SYSTEM LABEL
   ============================================================ */

.system-label {

    font-family: var(--mono);

    font-size: 20px;

    letter-spacing: 3px;

    text-transform: uppercase;

}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {

    text-align: center;

    padding: 18px 20px 22px;

    font-family: var(--mono);

    font-size: 14px;

    letter-spacing: 1px;

    opacity: .5;

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    * {

        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;

        transition: none !important;

    }

}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 700px) {

    .screen {

        padding-top: 35px;

        gap: 20px;

    }


    .title {

        font-size: clamp(
            1.7rem,
            8vw,
            3rem
        );

    }


    .computer {

        width: 96vw;

    }


    .controls {

        font-size: 8px;

    }


    .key {

        width: 30px;

        height: 30px;

        font-size: 11px;

    }


    .enter-key {

        font-size: 7px;

        padding: 8px 9px;

    }


    .system-label {

        font-size: 16px;

        letter-spacing: 2px;

    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 480px) {

    .screen {

        padding: 30px 12px 25px;

        gap: 16px;

    }


    .title {

        font-size: 1.55rem;

        text-shadow:
            2px 2px 0 var(--ink),
            4px 4px 0 rgba(10, 10, 10, .12);

    }


    .computer {

        width: 100%;

    }


    .controls {

        max-width: 320px;

        line-height: 2;

    }


    .prompt {

        font-size: 9px;

    }


    .system-label {

        font-size: 13px;

        letter-spacing: 1.5px;

    }


    .footer {

        font-size: 12px;

    }

}

.pixel-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-auto-rows: 5vh;
}

.pixel-transition span {
    background: #0a0a0a;
    transform: translateY(-120%);
}

.pixel-transition.active span {
    animation: pixelDrop 0.7s steps(4) forwards;
}

@keyframes pixelDrop {
    0% {
        transform: translateY(-120%);
    }

    100% {
        transform: translateY(0);
    }
}