:root {
    --phosphor: #78ff78;
    --bright: #b2ffb2;
    --dim: #35a835;
    --faint: #174817;
}

* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
}

body {
    color: var(--phosphor);
    font-family: "Courier New", Courier, monospace;
}

/* CRT DISPLAY */

#crt {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    padding: 3.5vh 5vw 4.5vh;

    background:
        radial-gradient(
            ellipse at center,
            #082008 0%,
            #031003 58%,
            #000 100%
        );

    text-shadow:
        0 0 3px #55ff55,
        0 0 9px rgba(70,255,70,.45);

    animation: crtFlicker 8s infinite;
}

/* SCANLINES */

#scanlines {
    position: absolute;
    inset: 0;
    z-index: 1000;
    pointer-events: none;

    background:
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,.28) 0,
            rgba(0,0,0,.28) 1px,
            transparent 1px,
            transparent 4px
        );

    box-shadow: inset 0 0 10vw #000;
}

/* ROLLING CRT BAND */

#sweep {
    position: absolute;
    left: 0;
    right: 0;
    top: -8vh;
    height: 5vh;
    z-index: 999;
    pointer-events: none;

    background:
        linear-gradient(
            transparent,
            rgba(130,255,130,.09),
            transparent
        );

    animation: sweep 9s linear infinite;
}

/* STATIC DURING SCREEN CHANGE */

#flash {
    position: absolute;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    opacity: 0;

    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 5px,
            rgba(150,255,150,.20) 6px,
            transparent 8px
        );
}

#flash.fire {
    animation: staticBurst .22s linear;
}

/* HEADER */

header {
    height: 9vh;

    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    align-items: center;

    border-bottom: 2px solid var(--phosphor);
}

.logo {
    font-size: clamp(25px,3vw,50px);
    font-weight: bold;
    letter-spacing: .16em;
}

.header-centre {
    text-align: center;
    color: var(--dim);
    font-size: clamp(12px,1.3vw,21px);
    letter-spacing: .14em;
}

#clock {
    text-align: right;
    color: var(--dim);
    font-size: clamp(13px,1.3vw,22px);
}

/* SCREENS */

main {
    height: 78vh;
}

.screen {
    display: none;
    height: 100%;
    padding-top: 2.5vh;
}

.screen.active {
    display: block;
    animation: screenOpen .20s linear;
}

.screen-title {
    margin-bottom: 2.2vh;
    font-size: clamp(23px,2.5vw,41px);
    font-weight: bold;
    letter-spacing: .15em;
}

/* COMMON */

.box {
    border: 1px solid var(--dim);
    padding: 1.8vh 1.8vw;
    background: rgba(0,30,0,.10);
}

.label {
    color: var(--dim);
    letter-spacing: .12em;
    font-size: clamp(13px,1.25vw,21px);
}

.huge {
    margin-top: 1vh;
    font-size: clamp(55px,8vw,125px);
    font-weight: bold;
    line-height: .95;
}

.progress {
    height: 7px;
    border: 1px solid var(--faint);
    margin: .2vh 0 .55vh;
}

.progress > div {
    height: 100%;
    background: var(--phosphor);
    box-shadow: 0 0 6px var(--phosphor);
}

/* GALACTIC STATUS */

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3vw;
}

.hero {
    min-height: 23vh;
}

.faction-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 2vw;
    margin-top: 3vh;
}

.faction-box {
    border-top: 1px solid var(--dim);
    padding-top: 1.5vh;
}

.faction-name {
    font-size: clamp(16px,1.5vw,25px);
    font-weight: bold;
}

.faction-count {
    margin-top: .5vh;
    font-size: clamp(24px,2.7vw,46px);
}

.faction-share {
    color: var(--dim);
    font-size: clamp(12px,1.1vw,18px);
}

/* ACTIVE FRONTS */

.front {
    margin-bottom: 2.3vh;
}

.front-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: .5vh;
    font-size: clamp(17px,1.6vw,27px);
    font-weight: bold;
}

.planet-row {
    display: grid;
    grid-template-columns: 2.4fr .9fr .8fr .8fr;
    gap: 1vw;
    padding: .35vh 0;
    font-size: clamp(12px,1.05vw,18px);
}

.defence {
    color: var(--bright);
    font-weight: bold;
}

/* MAJOR ORDER */

.mo {
    padding: 2.4vh 2vw;
}

.briefing {
    min-height: 8vh;
    font-size: clamp(16px,1.55vw,27px);
    line-height: 1.45;
}

.mo-meta {
    display: flex;
    justify-content: space-between;
    margin: 1.5vh 0 2.5vh;
    padding: 1vh 0;
    border-top: 1px solid var(--dim);
    border-bottom: 1px solid var(--dim);
    color: var(--bright);
    font-size: clamp(14px,1.3vw,22px);
}

.mo-task {
    margin-bottom: 2.2vh;
}

.mo-task-head {
    display: flex;
    justify-content: space-between;
    font-size: clamp(15px,1.4vw,24px);
}

.mo-numbers {
    margin-top: .4vh;
    color: var(--dim);
    font-size: clamp(12px,1.1vw,19px);
}

/* DEPLOYMENT */

.deployment-head,
.deployment-row {
    display: grid;
    grid-template-columns: 2.5fr 1.2fr 1fr .7fr;
    gap: 1vw;
}

.deployment-head {
    color: var(--dim);
    padding-bottom: 1vh;
    border-bottom: 1px solid var(--dim);
    font-size: clamp(12px,1vw,17px);
}

.deployment-row {
    padding: 1.1vh 0;
    border-bottom: 1px dotted var(--faint);
    font-size: clamp(14px,1.3vw,22px);
}

.rank {
    color: var(--dim);
}

/* FOOTER */

footer {
    position: absolute;
    left: 5vw;
    right: 5vw;
    bottom: 2.2vh;

    display: grid;
    grid-template-columns: 1fr 1fr 1fr;

    border-top: 1px solid var(--dim);
    padding-top: .8vh;

    color: var(--dim);
    font-size: clamp(10px,.9vw,15px);
}

footer span:nth-child(2) {
    text-align: center;
}

footer span:nth-child(3) {
    text-align: right;
}

/* DATA RECEIVED OVERLAY */

#transmission {
    position: absolute;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 800;

    background: rgba(0,8,0,.92);

    text-align: center;
    font-size: clamp(25px,4vw,65px);
    letter-spacing: .15em;
}

#transmission.show {
    display: flex;
    animation: transmission .65s linear;
}

#transmission strong {
    font-size: 1.35em;
}

.cursor {
    animation: blink 1s steps(1) infinite;
}

/* ANIMATIONS */

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

@keyframes crtFlicker {
    0%,95%,97%,100% { opacity: 1; }
    96% { opacity: .94; }
    98% { opacity: .97; }
}

@keyframes sweep {
    from { top: -8vh; }
    to   { top: 108vh; }
}

@keyframes screenOpen {
    0% {
        opacity: .15;
        transform: scaleY(.03);
        filter: brightness(3);
    }

    45% {
        opacity: .8;
        transform: scaleY(.7);
    }

    100% {
        opacity: 1;
        transform: scaleY(1);
        filter: brightness(1);
    }
}

@keyframes staticBurst {
    0%   { opacity: 0; }
    25%  { opacity: .8; }
    55%  { opacity: .25; }
    75%  { opacity: .7; }
    100% { opacity: 0; }
}

@keyframes transmission {
    0% {
        opacity: 0;
        transform: scaleY(.02);
    }

    20% {
        opacity: 1;
        transform: scaleY(1);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}


/* =================================================
   WARPI WEB v1.2 - CRT TERMINAL ENHANCEMENTS
   ================================================= */


/* subtle curved-glass vignette */

#crt::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1100;
    pointer-events: none;

    background:
        radial-gradient(
            ellipse at center,
            transparent 55%,
            rgba(0,0,0,.18) 75%,
            rgba(0,0,0,.72) 100%
        );

    box-shadow:
        inset 0 0 5vw rgba(0,0,0,.85),
        inset 0 0 1.5vw rgba(80,255,80,.08);
}


/* extremely subtle phosphor texture */

#crt::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1090;
    pointer-events: none;
    opacity: .11;

    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(100,255,100,.10) 0,
            rgba(100,255,100,.10) 1px,
            transparent 1px,
            transparent 3px
        );
}


/* brighter phosphor headings */

.screen-title,
.logo {
    color: var(--bright);

    text-shadow:
        0 0 3px var(--phosphor),
        0 0 8px rgba(100,255,100,.65),
        0 0 18px rgba(100,255,100,.25);
}


/* military terminal header decoration */

.header-centre::before {
    content: "[ ";
}

.header-centre::after {
    content: " ]";
}


/* slightly more terminal-like boxes */

.box {
    position: relative;
}

.box::before {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;

    top: -1px;
    left: -1px;

    border-top: 2px solid var(--bright);
    border-left: 2px solid var(--bright);
}

.box::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;

    right: -1px;
    bottom: -1px;

    border-right: 2px solid var(--bright);
    border-bottom: 2px solid var(--bright);
}


/* stronger defence warning */

.defence {
    animation: defencePulse 1.5s steps(2) infinite;
}


/* little phosphor pulse in progress bars */

.progress > div {
    position: relative;
    overflow: hidden;
}

.progress > div::after {
    content: "";
    position: absolute;

    top: 0;
    bottom: 0;
    width: 20%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(220,255,220,.75),
            transparent
        );

    animation: barSweep 3.5s linear infinite;
}


/* occasional tiny vertical picture instability */

main {
    animation: verticalHold 13s infinite;
}


/* cursor now behaves more like a terminal */

.cursor {
    display: inline-block;

    text-shadow:
        0 0 8px var(--phosphor);
}


/* CRT shutdown/open flash used during screen switch */

.screen.active {
    transform-origin: center center;
}


/* =================================================
   NEW ANIMATIONS
   ================================================= */

@keyframes defencePulse {

    0%, 70% {
        opacity: 1;
    }

    71%, 100% {
        opacity: .55;
    }
}


@keyframes barSweep {

    from {
        left: -30%;
    }

    to {
        left: 120%;
    }
}


@keyframes verticalHold {

    0%, 92%, 94%, 100% {
        transform: translateY(0);
    }

    92.5% {
        transform: translateY(1px);
    }

    93% {
        transform: translateY(-1px);
    }

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


/* make selection look like an old terminal too */

::selection {
    background: var(--phosphor);
    color: #001000;
}


/* =================================================
   WARPI v1.2 - SCREEN TRANSITIONS / UPLINK
   ================================================= */

#crt.screen-collapse main {
    animation: crtCollapse .20s ease-in forwards;
}

#crt.screen-restore main {
    animation: crtRestore .24s ease-out forwards;
}

@keyframes crtCollapse {
    0% {
        transform: scaleY(1);
        filter: brightness(1);
        opacity: 1;
    }

    70% {
        transform: scaleY(.025);
        filter: brightness(4);
        opacity: 1;
    }

    100% {
        transform: scaleY(0);
        filter: brightness(7);
        opacity: 0;
    }
}

@keyframes crtRestore {
    0% {
        transform: scaleY(.015);
        filter: brightness(5);
        opacity: .7;
    }

    55% {
        transform: scaleY(1.03);
        filter: brightness(1.8);
        opacity: 1;
    }

    100% {
        transform: scaleY(1);
        filter: brightness(1);
        opacity: 1;
    }
}


/* UPLINK STATUS */

#uplink.live {
    color: var(--bright);

    text-shadow:
        0 0 4px var(--phosphor),
        0 0 10px var(--phosphor);
}

#uplink.stale {
    opacity: .65;
    animation: staleBlink 1.2s steps(2) infinite;
}

#uplink.receiving {
    color: var(--bright);
    animation: receivePulse .25s steps(2) infinite;
}

@keyframes staleBlink {
    50% {
        opacity: .25;
    }
}

@keyframes receivePulse {
    50% {
        opacity: .35;
    }
}


/* brief interference burst */

#crt.signal-hit {
    animation: signalHit .16s linear;
}

@keyframes signalHit {
    0% {
        filter: brightness(1);
    }

    25% {
        filter: brightness(2.5) contrast(1.7);
        transform: translateX(2px);
    }

    50% {
        filter: brightness(.7) contrast(2);
        transform: translateX(-3px);
    }

    75% {
        filter: brightness(1.8);
        transform: translateX(1px);
    }

    100% {
        filter: none;
        transform: translateX(0);
    }
}


/* =================================================
   WARPI v1.2 - MAJOR ORDER TACTICAL DISPLAY
   ================================================= */

.mo {
    position: relative;
    overflow: hidden;
}

.mo::after {
    content: "PRIORITY TRANSMISSION";
    position: absolute;
    top: 1.1vh;
    right: 1.4vw;

    color: var(--dim);
    font-size: clamp(9px,.75vw,13px);
    letter-spacing: .18em;
}

.mo-header {
    border-left: 3px solid var(--bright);
    padding-left: 1.2vw;
    margin-bottom: 1.8vh;
}

.mo-classification {
    color: var(--dim);
    font-size: clamp(10px,.9vw,15px);
    letter-spacing: .18em;
    margin-bottom: .7vh;
}

.mo .briefing {
    min-height: 0;
    color: var(--bright);
    font-size: clamp(17px,1.6vw,28px);
    line-height: 1.35;
    font-weight: bold;
}

.mo-meta {
    margin: 1.4vh 0 1.8vh;
}

#moReward::before {
    content: "◆ ";
}

#moCountdown::before {
    content: "T-";
}

.mo-objectives-title {
    color: var(--dim);
    letter-spacing: .16em;
    font-size: clamp(10px,.9vw,15px);

    margin-bottom: 1vh;
}

.mo-task {
    position: relative;

    margin-bottom: 1.4vh;
    padding: 1vh 1vw;

    border-left: 1px solid var(--dim);
    border-right: 1px solid var(--faint);

    background:
        linear-gradient(
            90deg,
            rgba(70,255,70,.055),
            transparent 65%
        );
}

.mo-task.complete {
    border-left: 3px solid var(--bright);
}

.mo-task-head {
    align-items: center;
}

.mo-faction {
    font-weight: bold;
    letter-spacing: .09em;
}

.mo-percent {
    color: var(--bright);
    font-weight: bold;
    font-size: 1.15em;
}

.mo-numbers {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mo-state {
    letter-spacing: .12em;
}

.mo-state.complete {
    color: var(--bright);
    animation: objectiveComplete 1.2s steps(2) infinite;
}

.mo .progress {
    height: 10px;
    margin-top: .65vh;
    margin-bottom: .55vh;

    border-color: var(--dim);

    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 9%,
            rgba(80,255,80,.10) 10%
        );
}

.mo-warning {
    margin-top: 1vh;
    padding-top: 1vh;

    border-top: 1px dotted var(--dim);

    color: var(--dim);
    text-align: center;

    font-size: clamp(9px,.8vw,14px);
    letter-spacing: .16em;
}

@keyframes objectiveComplete {
    50% {
        opacity: .45;
    }
}


/* =================================================
   WARPI v1.3 - SUPER EARTH MAJOR ORDER DISPLAY
   ================================================= */

.mo-screen {
    padding-top: 2vh;
}

.mo-layout {
    height: 100%;

    display: grid;
    grid-template-columns: 37% 63%;

    gap: 3vw;
}


/* -------------------------------------------------
   SUPER EARTH PANEL
------------------------------------------------- */

.se-panel {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-width: 0;

    border-right:
        1px solid var(--dim);

    padding-right: 3vw;

    text-align: center;
}


.se-emblem {
    position: relative;

    width: min(26vw, 360px);
    height: min(26vw, 360px);

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--bright);

    text-shadow:
        0 0 4px var(--phosphor),
        0 0 12px var(--phosphor),
        0 0 28px rgba(100,255,100,.35);
}


.se-globe {
    position: absolute;

    font-size:
        clamp(150px,17vw,280px);

    line-height: 1;

    opacity: .88;
}


.se-wings {
    position: absolute;

    font-size:
        clamp(35px,4vw,65px);

    letter-spacing: .1em;

    transform:
        scaleY(2.6);

    opacity: .8;
}


.se-stars {
    position: absolute;

    top: 7%;

    font-size:
        clamp(16px,1.5vw,24px);

    letter-spacing: .25em;
}


.se-star-bottom {
    position: absolute;

    bottom: 4%;

    font-size:
        clamp(40px,4vw,70px);
}


.se-title {
    width: 100%;

    margin-top: .5vh;

    padding-bottom: .7vh;

    border-bottom:
        2px solid var(--phosphor);

    color: var(--bright);

    font-size:
        clamp(30px,3.3vw,57px);

    font-weight: bold;

    letter-spacing: .08em;

    text-shadow:
        0 0 5px var(--phosphor),
        0 0 16px rgba(100,255,100,.5);
}


.se-motto {
    width: 100%;

    display: flex;
    justify-content: space-between;

    padding:
        1.1vh .5vw;

    border-bottom:
        1px solid var(--dim);

    font-size:
        clamp(11px,1.15vw,19px);

    letter-spacing: .08em;
}


.se-motto span {
    color: var(--dim);
}


.se-divider {
    width: 60%;

    margin:
        2.5vh 0
        1.8vh;

    border-top:
        1px solid var(--faint);
}


.se-command {
    color: var(--dim);

    font-size:
        clamp(10px,.9vw,15px);

    line-height: 1.7;

    letter-spacing: .16em;
}


/* -------------------------------------------------
   COMMAND SIDE
------------------------------------------------- */

.mo-command {
    min-width: 0;

    padding-right: 1vw;
}


.mo-titlebar {
    height: 8vh;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding:
        0 1.4vw;

    border:
        1px solid var(--phosphor);

    color: var(--bright);
}


.mo-titlebar > span {
    font-size:
        clamp(27px,3vw,50px);

    font-weight: bold;

    letter-spacing: .12em;
}


.mo-titlebar small {
    color: var(--dim);

    font-size:
        clamp(9px,.8vw,14px);

    letter-spacing: .16em;
}


.mo-directive {
    margin-top: 1.5vh;

    padding:
        1.2vh 1.2vw;

    border-left:
        5px solid var(--bright);

    background:
        linear-gradient(
            90deg,
            rgba(80,255,80,.09),
            transparent
        );
}


.mo-directive-label {
    margin-bottom: .8vh;

    color: var(--dim);

    font-size:
        clamp(10px,.9vw,15px);

    letter-spacing: .13em;
}


.mo-directive .briefing {
    min-height: 0;

    color: var(--bright);

    font-size:
        clamp(15px,1.35vw,23px);

    line-height: 1.35;

    font-weight: bold;
}


.mo-command .mo-meta {
    margin:
        1.4vh 0
        1.6vh;

    padding:
        1.1vh 1vw;

    border:
        1px solid var(--dim);

    font-size:
        clamp(12px,1.1vw,19px);
}


.mo-command .mo-task {
    margin-bottom: 1vh;

    padding:
        .8vh .8vw;
}


.mo-command .mo-task-head {
    font-size:
        clamp(13px,1.15vw,20px);
}


.mo-command .mo-numbers {
    font-size:
        clamp(10px,.9vw,16px);
}


.mo-command .progress {
    height: 9px;
}


/* hide the old generated header wrapper because
   the v1.3 page now provides the command framing */

.mo-directive .mo-header {
    border: 0;
    padding: 0;
    margin: 0;
}


.mo-directive .mo-classification {
    display: none;
}


/* -------------------------------------------------
   CRT EMBLEM INSTABILITY
------------------------------------------------- */

.se-emblem {
    animation:
        emblemPhosphor 6s infinite;
}


@keyframes emblemPhosphor {

    0%, 94%, 100% {
        opacity: 1;
        transform: translateX(0);
    }

    95% {
        opacity: .82;
        transform: translateX(1px);
    }

    96% {
        opacity: 1;
        transform: translateX(-1px);
    }

    97% {
        opacity: .9;
        transform: translateX(0);
    }
}


/* =================================================
   WARPI v1.3 - REAL SUPER EARTH EMBLEM
   ================================================= */

.se-emblem-real {
    width: 100%;
    height: auto;
    max-width: 440px;

    margin: 0 auto 1.5vh;

    animation: emblemPhosphor 6s infinite;
}

.se-emblem-real img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: contain;

    filter:
        brightness(1.05)
        contrast(1.08)
        drop-shadow(0 0 5px rgba(120,255,120,.55))
        drop-shadow(0 0 15px rgba(80,255,80,.20));

    opacity: .96;
}

.se-panel .se-command {
    margin-top: 1vh;
}


/* =================================================
   WARPI v1.4 - TACTICAL NAVIGATION
   ================================================= */

#warpi-nav {
    position: absolute;

    left: 5vw;
    right: 5vw;
    bottom: 5.2vh;

    min-height: 4.5vh;

    display: grid;
    grid-template-columns:
        .45fr
        1.35fr
        1.25fr
        1.25fr
        1.15fr
        .45fr
        .65fr;

    gap: .45vw;

    align-items: stretch;

    z-index: 700;

    border-top:
        1px solid var(--dim);

    border-bottom:
        1px solid var(--dim);

    padding: .45vh 0;
}


#warpi-nav button {
    appearance: none;

    border: 0;

    background:
        transparent;

    color:
        var(--dim);

    font-family:
        "Courier New",
        Courier,
        monospace;

    font-size:
        clamp(9px,.82vw,14px);

    letter-spacing:
        .08em;

    cursor: pointer;

    text-shadow:
        0 0 5px
        rgba(80,255,80,.30);

    transition:
        color .12s,
        background .12s,
        text-shadow .12s;
}


#warpi-nav button:hover {
    color:
        var(--bright);

    background:
        rgba(80,255,80,.07);

    text-shadow:
        0 0 8px
        var(--phosphor);
}


#warpi-nav button:focus-visible {
    outline:
        1px solid
        var(--bright);

    outline-offset:
        -2px;
}


#warpi-nav .nav-page.active {
    color:
        var(--bright);

    background:
        rgba(80,255,80,.10);

    box-shadow:
        inset 0 -2px 0
        var(--phosphor);

    text-shadow:
        0 0 5px
        var(--phosphor),
        0 0 12px
        rgba(80,255,80,.45);
}


#warpi-nav .nav-arrow {
    color:
        var(--phosphor);

    font-size:
        clamp(14px,1.2vw,21px);
}


#warpi-nav .nav-auto {
    border-left:
        1px solid
        var(--faint);

    letter-spacing:
        .14em;
}


#warpi-nav .nav-auto.active {
    color:
        var(--bright);

    text-shadow:
        0 0 7px
        var(--phosphor);
}


#warpi-nav .nav-auto.active::before {
    content:
        "● ";
}


#warpi-nav .nav-auto:not(.active)::before {
    content:
        "■ ";
}


/*
   Navigation occupies some of the space
   previously available to the screens.
*/

main {
    height: 73vh;
}


footer {
    bottom: 1.5vh;
}


/* =================================================
   WARPI v1.4.1 - MOBILE NAVIGATION FIX
   ================================================= */

/* Keep navigation visibly above the footer */
#warpi-nav {
    bottom: 4.5rem;
}

/* Don't artificially shrink the display area */
main {
    height: auto;
    bottom: 8.5rem;
}


/* ---------- PHONE / NARROW DISPLAY ---------- */

@media (max-width: 700px) {

    #warpi-nav {
        left: 2vw;
        right: 2vw;
        bottom: 3.6rem;

        display: grid;

        grid-template-columns:
            42px
            repeat(4, 1fr)
            42px;

        gap: 2px;

        min-height: 42px;

        padding: 3px 0;
    }


    #warpi-nav button {
        min-height: 40px;

        padding: 2px;

        font-size: 8px;

        letter-spacing: 0;

        line-height: 1.05;
    }


    #warpi-nav .nav-arrow {
        font-size: 16px;
    }


    /*
       AUTO becomes a small floating status/control
       immediately above the navigation row.
    */

    #warpi-nav .nav-auto {
        position: absolute;

        right: 0;
        bottom: 46px;

        min-width: 74px;
        min-height: 28px;

        border:
            1px solid var(--dim);

        background:
            rgba(0,20,0,.75);

        font-size: 8px;
    }


    main {
        bottom: 8rem;
    }


    footer {
        bottom: 1rem;
        font-size: 7px;
    }
}


/* =================================================
   WARPI v1.4.2 - MOBILE NAV FINAL
   ================================================= */

@media (max-width: 700px) {

    /*
     * Navigation becomes a fixed control deck on mobile.
     * Safari safe-area support keeps it clear of the
     * Home indicator/browser chrome.
     */

    #warpi-nav {
        position: fixed !important;

        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: 100%;

        box-sizing: border-box;

        display: grid !important;
        grid-template-columns:
            38px
            repeat(4, minmax(0, 1fr))
            38px !important;

        gap: 1px;

        padding:
            4px
            4px
            calc(4px + env(safe-area-inset-bottom));

        min-height: 52px;

        background:
            rgba(0, 12, 0, .96);

        border-top:
            1px solid var(--phosphor);

        border-bottom: 0;

        z-index: 99999 !important;

        box-shadow:
            0 -4px 18px
            rgba(50,255,50,.12);
    }


    #warpi-nav button {
        display: block;

        min-width: 0;
        min-height: 44px;

        padding: 3px 1px;

        overflow: hidden;

        font-size: 7px;

        line-height: 1.1;

        white-space: normal;

        text-align: center;
    }


    #warpi-nav .nav-arrow {
        font-size: 17px;
    }


    /*
     * AUTO/MANUAL sits above the right side
     * of the navigation deck.
     */

    #warpi-nav .nav-auto {
        position: absolute !important;

        right: 5px;
        bottom: calc(56px + env(safe-area-inset-bottom));

        width: 82px;
        min-height: 30px;

        padding: 4px;

        background:
            rgba(0,15,0,.96);

        border:
            1px solid var(--phosphor);

        font-size: 8px;

        overflow: visible;
    }


    /*
     * Leave enough room that information at the
     * bottom of a WarPi screen isn't hidden by nav.
     */

    body {
        padding-bottom:
            calc(58px + env(safe-area-inset-bottom));
    }
}


/* =================================================
   WARPI v1.5 - GALACTIC UPDATE TRANSMISSION
   ================================================= */

#galactic-update {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8vw;

    box-sizing: border-box;

    background:
        rgba(0, 10, 0, .94);

    color: var(--bright);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    z-index: 200000;

    font-family:
        "Courier New",
        Courier,
        monospace;

    text-align: center;
}


#galactic-update.visible {
    visibility: visible;

    animation:
        galacticTransmission
        3.8s
        linear
        forwards;
}


.update-frame {
    width: min(760px, 90vw);

    padding: clamp(18px, 4vw, 42px);

    border:
        1px solid
        var(--phosphor);

    box-shadow:
        inset 0 0 35px
        rgba(80,255,80,.06),
        0 0 18px
        rgba(80,255,80,.16);

    text-shadow:
        0 0 6px
        var(--phosphor);
}


.update-classification {
    color: var(--dim);

    font-size:
        clamp(8px, 1.1vw, 13px);

    letter-spacing: .24em;

    margin-bottom: 2em;
}


.update-title {
    font-size:
        clamp(18px, 3vw, 38px);

    font-weight: bold;

    letter-spacing: .12em;

    text-shadow:
        0 0 6px
        var(--phosphor),
        0 0 18px
        rgba(80,255,80,.45);
}


.update-rule {
    width: 70%;

    height: 1px;

    margin:
        1.6em auto;

    background:
        var(--phosphor);

    box-shadow:
        0 0 8px
        var(--phosphor);
}


#update-reason {
    font-size:
        clamp(11px, 1.5vw, 18px);

    letter-spacing: .13em;
}


.update-footer {
    margin-top: 3em;

    color: var(--dim);

    font-size:
        clamp(7px, .9vw, 11px);

    letter-spacing: .16em;
}


@keyframes galacticTransmission {

    0% {
        opacity: 0;
        transform:
            scaleY(.02);
    }

    5% {
        opacity: 1;
        transform:
            scaleY(1);
    }

    8% {
        opacity: .35;
    }

    11% {
        opacity: 1;
    }

    88% {
        opacity: 1;
    }

    94% {
        opacity: .7;
        transform:
            scaleY(1);
    }

    100% {
        opacity: 0;
        transform:
            scaleY(.02);
    }
}


/* Mobile */

@media (max-width: 700px) {

    #galactic-update {
        padding: 20px;
    }

    .update-frame {
        width: 100%;
    }

}


/* =================================================
   WARPI v1.5.1 - CRT READABILITY PASS
   ================================================= */

/*
 * Sharper phosphor text.
 * Keep the glow, but stop it overwhelming the glyphs.
 */

body,
.screen {
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}


/* Main information */

.screen {
    color: #baffba;
}

.screen p,
.screen li,
.screen td,
.screen .value,
.screen .stat,
.screen .campaign,
.screen .objective {
    font-weight: 600;

    text-shadow:
        0 0 2px rgba(120,255,120,.65),
        0 0 5px rgba(80,255,80,.18);
}


/* Headings stay brighter */

.screen h1,
.screen h2,
.screen h3,
.mo-titlebar,
.mo-directive {
    color: #d2ffd2;

    text-shadow:
        0 0 2px #8fff8f,
        0 0 7px rgba(80,255,80,.35);
}


/* Navigation */

#warpi-nav button {
    font-weight: 600;

    text-shadow:
        0 0 2px rgba(80,255,80,.45);
}

#warpi-nav .nav-page.active {
    color: #d2ffd2;

    text-shadow:
        0 0 3px rgba(100,255,100,.75);
}


/* Priority transmission */

.update-title {
    color: #d8ffd8;

    text-shadow:
        0 0 2px #8fff8f,
        0 0 8px rgba(80,255,80,.30);
}

#update-reason {
    color: #caffca;

    font-weight: 700;

    text-shadow:
        0 0 2px rgba(100,255,100,.55);
}

.update-classification,
.update-footer {
    color: #9ee89e;

    text-shadow:
        0 0 2px rgba(80,255,80,.25);
}


/*
 * Mobile needs slightly larger type rather than
 * simply scaling the desktop terminal down.
 */

@media (max-width: 700px) {

    .screen p,
    .screen li,
    .screen td,
    .screen .value,
    .screen .stat,
    .screen .campaign,
    .screen .objective {
        font-weight: 700;
    }

    #warpi-nav button {
        font-size: 8px;
        font-weight: 700;
    }

    .update-title {
        font-size: clamp(20px, 7vw, 30px);
    }

    #update-reason {
        font-size: clamp(13px, 4vw, 18px);
        line-height: 1.4;
    }
}
