:root {
    --crt-red: #da3131;
    --crt-green: #709f73;
    --crt-blue: #2881ce;
    --bg: #011103;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

/* Global */
html {
    font-size: 1.5rem;
    font-family: "Courier New", "Lucida Console", monospace;
    min-height: 100%;
    font-weight: 600;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

main {
    height: 100vh;
    height: 100dvh;
    color: rgba(255, 255, 255, 0.75);
    height: 100vh;
    overflow: hidden;
}

.green {
    color: rgb(0, 255, 0);
}

.pink {
    color: pink;
}

.yellow {
    color: yellow;
}

.lightblue {
    color: lightblue;
}

.code {
    color: attr(data-color);
}

.wrapper {
    padding-top: 3rem;
    padding-right: 2rem;
    padding-left: 2rem;
    padding-bottom: 3rem;
    display: inline-block;
    white-space: normal;
    overflow: visible;
    max-width: 100%;
}

.code {
    animation: typewriter 1s steps(14) 1s 1 normal both;
    line-height: 1;
    margin: 0;
    display: inline-block;
    white-space: nowrap;
    overflow-x: hidden;
}

/* Animation */
@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkTextCursor {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.terminal {
    position: relative;
    height: 100%;
    overflow-y: auto;
}

.unselectable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.input-line {
    display: inline-flex;
    align-items: baseline;
    cursor: default;
}

.input-line * {
    cursor: default;
}

/* The editable text */
.editable {
    outline: none;

    color: inherit;
    font: inherit;
    letter-spacing: inherit;

    /* Hide real caret */
    caret-color: transparent;

    /* Ensure glow matches exactly */
    text-shadow: inherit;

    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;

    max-width: 95%;
    display: inline-block;
    min-width: 0;
}

.editable:empty::before {
    content: "";
    display: inline-block;
}

/* Blinking underscore cursor */
.cursor {
    display: inline-block;
    margin-left: 2px;

    transform: translateY(-1px);

    color: inherit;
    text-shadow: inherit;

    animation: blinkTextCursor 1s steps(1, start) infinite;
}

.prompt-space {
    display: inline-block;
    width: 1ch;
    /* exactly one character space */
}

@keyframes flicker {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

.boot-line {
    animation: flicker 0.2s ease-in;
    white-space: pre;
}

.crt-glitch {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.crt-line {
    position: absolute;
    width: 100%;
    height: 2px;

    background: rgba(255, 255, 255, 0.05);

    animation: glitch-move 0.6s linear forwards;
    z-index: 10;
}

@keyframes glitch-move {
    from {
        transform: translateY(-10%);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    to {
        transform: translateY(110%);
        opacity: 0;
    }
}

#window-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    /* terminal still usable when no window */
    z-index: 5;
}

.window {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    background: var(--bg);
    border: 1px solid rgb(0, 255, 0);

    color: rgb(0, 255, 0);
    font-family: "Courier New", monospace;

    padding: 1ch;

    pointer-events: auto;

    display: none;
    z-index: 5;

    filter:
        blur(0.2px) drop-shadow(0 0 1px rgba(0, 255, 0, 0.8)) drop-shadow(0 0 2px rgba(0, 255, 0, 0.4));
}

@keyframes window-flicker {
    0% {
        opacity: 0;
        filter: brightness(2);
    }

    10% {
        opacity: 1;
        filter: brightness(0.5);
    }

    20% {
        opacity: 0.8;
        filter: brightness(1.8);
    }

    30% {
        opacity: 1;
        filter: brightness(0.8);
    }

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

.window.opening {
    animation: window-flicker 0.25s ease-out;
}

.window.ghost {
    pointer-events: none;
    opacity: 0.3;

    filter:
        blur(1px) brightness(1.2) drop-shadow(0 0 6px rgba(0, 255, 0, 0.4));

    animation: ghost-fade 1.2s forwards;
}

@keyframes ghost-fade {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 0;
    }
}

.window::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    /* background:
        repeating-linear-gradient(var(--crt-red) 0px, var(--crt-green) 2px, var(--crt-blue) 4px),
        repeating-linear-gradient(90deg, var(--crt-red) 1px, var(--crt-green) 2px, var(--crt-blue) 3px); */

    mix-blend-mode: overlay;
}


#output div {
    white-space: pre-wrap;
}

#output {
    max-width: 100%;
}

button {
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    padding: 10px 20px;
    border-radius: 100px;
    background: var(--bg);
    border: 1px solid rgb(0, 255, 0);
    display: flex;
    align-items: center;
    font-size: 15px;
    color: white;
    text-shadow: inherit;
    filter: drop-shadow(0 0 4px rgba(0, 255, 0, 0.8)) drop-shadow(0 0 8px rgba(0, 255, 0, 0.4));
    align-self: center;
}

button:hover {
    background: transparent
}

button>svg {
    text-shadow: inherit;
    /* filter: drop-shadow(0 0 4px rgba(0, 255, 0, 0.8)) drop-shadow(0 0 8px rgba(0, 255, 0, 0.4)); */
    width: 34px;
    margin-left: 10px;
    transition: transform 0.3s ease-in-out;
    transform: scale(1.2);
}

button:hover svg {
    transform: translateX(5px) scale(1.2);

    /* transform: scale(1.4); */
}

button:active {
    transform: scale(0.95);
}

.startButtonContainer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
}

#window-backdrop {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.42);

    opacity: 0;
    pointer-events: none;

    transition:
        opacity 0.12s linear;

    z-index: 3;

    overflow: hidden;
}
#window-backdrop::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,0.025) 0px,
            rgba(255,255,255,0.025) 1px,
            transparent 2px,
            transparent 4px
        );

    opacity: 0.25;

    animation: backdropScanlines 0.2s linear infinite;
}
#window-backdrop::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background: rgba(0, 20, 0, 0.08);

    opacity: 0.4;

    animation: backdropFlicker 0.12s infinite;
}
@keyframes backdropScanlines {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(4px);
    }
}
#window-backdrop {
    mix-blend-mode: multiply;
    filter:
        brightness(0.55)
        contrast(0.75)
        saturate(0.6);

    transition:
        filter 0.12s linear;
}

@keyframes backdropFlicker {
    0%   { opacity: 0.28; }
    20%  { opacity: 0.38; }
    40%  { opacity: 0.32; }
    60%  { opacity: 0.42; }
    80%  { opacity: 0.3; }
    100% { opacity: 0.36; }
}

/* active state */
#window-backdrop.active {
    opacity: 1;
}

.window-image {

    object-fit: contain;

    image-rendering: pixelated;

    user-select: none;

    pointer-events: none;

    /* filter:
        brightness(0.9)
        contrast(1.2)
        saturate(0.8)
        grayscale(0.2); */
    /* filter:
        brightness(0.9) contrast(0.85) saturate(0.7) sepia(0.08) hue-rotate(10deg); */

    opacity: 1;
    z-index: -50;
}
.image-wrapper {
    position: relative;
    display: inline-block;
}

.selected-image {
    position: relative;

    border: 2px solid rgb(0, 255, 0);

    box-shadow:
        0 0 4px rgba(0, 255, 0, 0.8),
        0 0 10px rgba(0, 255, 0, 0.4),
        inset 0 0 6px rgba(0, 255, 0, 0.25);

    animation: selectedPulse 1.2s infinite alternate;
}

@keyframes selectedPulse {
    from {
        box-shadow:
            0 0 2px rgba(0, 255, 0, 0.6),
            0 0 6px rgba(0, 255, 0, 0.3),
            inset 0 0 4px rgba(0, 255, 0, 0.2);
    }

    to {
        box-shadow:
            0 0 6px rgba(0, 255, 0, 1),
            0 0 16px rgba(0, 255, 0, 0.5),
            inset 0 0 8px rgba(0, 255, 0, 0.3);
    }
}

@keyframes flicker {
    0% {
        opacity: 0.27861;
    }

    5% {
        opacity: 0.34769;
    }

    10% {
        opacity: 0.23604;
    }

    15% {
        opacity: 0.90626;
    }

    20% {
        opacity: 0.18128;
    }

    25% {
        opacity: 0.83891;
    }

    30% {
        opacity: 0.65583;
    }

    35% {
        opacity: 0.67807;
    }

    40% {
        opacity: 0.26559;
    }

    45% {
        opacity: 0.84693;
    }

    50% {
        opacity: 0.96019;
    }

    55% {
        opacity: 0.08594;
    }

    60% {
        opacity: 0.20313;
    }

    65% {
        opacity: 0.71988;
    }

    70% {
        opacity: 0.53455;
    }

    75% {
        opacity: 0.37288;
    }

    80% {
        opacity: 0.71428;
    }

    85% {
        opacity: 0.70419;
    }

    90% {
        opacity: 0.7003;
    }

    95% {
        opacity: 0.36108;
    }

    100% {
        opacity: 0.24387;
    }
}

@keyframes textShadow {
    0% {
        text-shadow: 0.4389924193300864px 0 1px rgba(0, 30, 255, 0.5), -0.4389924193300864px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    5% {
        text-shadow: 2.7928974010788217px 0 1px rgba(0, 30, 255, 0.5), -2.7928974010788217px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    10% {
        text-shadow: 0.02956275843481219px 0 1px rgba(0, 30, 255, 0.5), -0.02956275843481219px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    15% {
        text-shadow: 0.40218538552878136px 0 1px rgba(0, 30, 255, 0.5), -0.40218538552878136px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    20% {
        text-shadow: 3.4794037899852017px 0 1px rgba(0, 30, 255, 0.5), -3.4794037899852017px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    25% {
        text-shadow: 1.6125630401149584px 0 1px rgba(0, 30, 255, 0.5), -1.6125630401149584px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    30% {
        text-shadow: 0.7015590085143956px 0 1px rgba(0, 30, 255, 0.5), -0.7015590085143956px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    35% {
        text-shadow: 3.896914047650351px 0 1px rgba(0, 30, 255, 0.5), -3.896914047650351px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    40% {
        text-shadow: 3.870905614848819px 0 1px rgba(0, 30, 255, 0.5), -3.870905614848819px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    45% {
        text-shadow: 2.231056963361899px 0 1px rgba(0, 30, 255, 0.5), -2.231056963361899px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    50% {
        text-shadow: 0.08084290417898504px 0 1px rgba(0, 30, 255, 0.5), -0.08084290417898504px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    55% {
        text-shadow: 2.3758461067427543px 0 1px rgba(0, 30, 255, 0.5), -2.3758461067427543px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    60% {
        text-shadow: 2.202193051050636px 0 1px rgba(0, 30, 255, 0.5), -2.202193051050636px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    65% {
        text-shadow: 2.8638780614874975px 0 1px rgba(0, 30, 255, 0.5), -2.8638780614874975px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    70% {
        text-shadow: 0.48874025155497314px 0 1px rgba(0, 30, 255, 0.5), -0.48874025155497314px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    75% {
        text-shadow: 1.8948491305757957px 0 1px rgba(0, 30, 255, 0.5), -1.8948491305757957px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    80% {
        text-shadow: 0.0833037308038857px 0 1px rgba(0, 30, 255, 0.5), -0.0833037308038857px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    85% {
        text-shadow: 0.09769827255241735px 0 1px rgba(0, 30, 255, 0.5), -0.09769827255241735px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    90% {
        text-shadow: 3.443339761481782px 0 1px rgba(0, 30, 255, 0.5), -3.443339761481782px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    95% {
        text-shadow: 2.1841838852799786px 0 1px rgba(0, 30, 255, 0.5), -2.1841838852799786px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }

    100% {
        text-shadow: 2.6208764473832513px 0 1px rgba(0, 30, 255, 0.5), -2.6208764473832513px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 20;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 20;
    background-size: 500% 3px, 6px 500%;
    pointer-events: none;
}

.crt {
    animation: textShadow 1.6s infinite;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 200px rgba(0, 0, 0, 0.9) inset;
}

/* container */
.crt {
  position: relative;
  overflow: hidden;
}

/* inner warp layer (THIS replaces transform-based shaking) */
.crt-warp {
  position: relative;
  height: 100%;
}

.crt-warp::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 3px
  );

  animation: scanJitter 0.12s infinite steps(2, end);
  mix-blend-mode: overlay;
  opacity: 0.6;
}

.crt-warp::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 3px
  );

  animation: scanJitter 0.12s infinite steps(2, end);
  mix-blend-mode: overlay;
  opacity: 0.6;
}

@keyframes signalHit {
  0% {
    transform: translate(0, 0) skew(0deg);
    clip-path: inset(0 0 0 0);
  }

  10% {
    transform: translate(-8px, 2px) skew(1deg);
    clip-path: inset(2% 0 85% 0);
  }

  25% {
    transform: translate(6px, -3px) skew(-1.5deg);
    clip-path: inset(40% 0 30% 0);
  }

  40% {
    transform: translate(-10px, 1px) skew(2deg);
    clip-path: inset(10% 0 60% 0);
  }

  60% {
    transform: translate(4px, -2px) skew(-1deg);
    clip-path: inset(70% 0 10% 0);
  }

  80% {
    transform: translate(-2px, 1px);
    clip-path: inset(0 0 0 0);
  }

  100% {
    transform: translate(0, 0);
  }
}

.crt.signal-hit .crt-warp {
  animation: signalHit 0.18s linear;
}


@font-face {
    font-family: 'PalmuOSIcons'; /*a name to be used later*/
    src: url('resources/palmuosicons.ttf'); /*URL to font*/
}

.iconClass {
    font-family: 'PalmuOSIcons' !important;
}