* {
    box-sizing: border-box;
    user-select: none;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #171717;
    font-family: Tahoma, Arial, sans-serif;
}


.computer {
    width: 100vw;
    height: 100vh;
    padding: 25px;

    display: flex;
    gap: 20px;

    background: linear-gradient(
        145deg,
        #c8c0b2,
        #817867
    );

    border-radius: 18px;

    box-shadow:
        inset 0 0 35px #514a40;
}


.monitor {
    flex: 1;
    min-width: 0;

    position: relative;
    overflow: hidden;

    border-radius: 25px;

    background: #000;

    box-shadow:
        inset 0 0 45px #000,
        0 0 15px #000;
}


.desktop {
    position: absolute;
    inset: 0;

    overflow: hidden;

    background: linear-gradient(
        135deg,
        #126b2b,
        #08752a
    );

    color: white;
}


.icons {
    position: absolute;

    left: 12px;
    top: 12px;
    bottom: 48px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    z-index: 2;
}

.icon {
    width: 80px;
    padding: 4px;

    text-align: center;

    color: white;

    font-size: 12px;

    text-shadow: 1px 1px #000;

    cursor: pointer;
}

.icon:hover {
    background: rgba(0, 0, 128, .45);
}

.icon-img {
    display: block;

    font-size: 32px;

    margin-bottom: 3px;
}


.window {
    position: absolute;

    display: none;

    width: 400px;
    height: 280px;

    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #fff
        #404040
        #404040
        #fff;

    box-shadow:
        5px 5px 0 rgba(0, 0, 0, .35);

    color: #000;

    z-index: 10;
}



.titlebar {
    height: 25px;

    padding: 3px 4px;

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

    background: #000080;

    color: white;

    font-size: 12px;
    font-weight: bold;

    cursor: move;
}

.titlebar.inactive {
    background: #808080;
}



.winbuttons {
    display: flex;
    gap: 2px;
}

.wbtn {
    width: 20px;
    height: 18px;

    padding: 0;

    background: #c0c0c0;
    color: #000;

    border: 2px solid;

    border-color:
        #fff
        #404040
        #404040
        #fff;

    font-size: 11px;
    font-weight: bold;

    line-height: 12px;

    cursor: pointer;
}

.wbtn:active {
    border-color:
        #404040
        #fff
        #fff
        #404040;
}



.content {
    height: calc(100% - 25px);

    padding: 8px;

    overflow: auto;

    background: white;
}



.menu {
    position: absolute;

    left: 3px;
    bottom: 40px;

    width: 230px;

    display: none;

    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #fff
        #404040
        #404040
        #fff;

    box-shadow:
        4px 4px 0 #222;

    color: #000;

    z-index: 3000;
}

.menu.open {
    display: block;
}

.menu-head {
    padding: 10px;

    background: #000080;

    color: white;

    font-size: 18px;
    font-weight: bold;
}

.menu-item {
    padding: 9px 12px;

    font-size: 13px;

    cursor: pointer;
}

.menu-item:hover {
    background: #000080;
    color: white;
}

.menu-sep {
    margin: 2px 0;

    border-top: 1px solid #808080;
    border-bottom: 1px solid white;
}


.taskbar {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 40px;

    display: flex;
    align-items: center;

    padding: 3px;

    background: #c0c0c0;

    border-top: 2px solid white;

    color: #000;

    z-index: 2500;
}

.start {
    height: 32px;

    padding: 0 12px;

    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #fff
        #404040
        #404040
        #fff;

    font-weight: bold;

    cursor: pointer;
}

.start:active {
    border-color:
        #404040
        #fff
        #fff
        #404040;
}

.tasks {
    display: flex;

    gap: 4px;

    margin-left: 5px;

    min-width: 0;

    overflow: hidden;
}

.task {
    height: 30px;

    min-width: 95px;
    max-width: 145px;

    padding: 5px 8px;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;

    background: #c0c0c0;

    border: 2px inset #aaa;

    font-size: 11px;

    cursor: pointer;
}

.task.active {
    font-weight: bold;

    border: 2px inset #404040;
}


.volume {
    display: flex;

    align-items: center;

    gap: 5px;

    margin-left: auto;

    padding: 0 6px;
}

.volume input {
    width: 75px;

    cursor: pointer;
}


.clock {
    padding: 6px 8px;

    border: 2px inset #aaa;

    font: 11px monospace;
}


.power {
    width: 30px;
    height: 30px;

    display: flex;

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

    font-size: 21px;

    color: #222;

    cursor: pointer;
}

.power:hover {
    color: #800000;
}


.boot-screen {
    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    padding: 35px;

    background: #000;

    color: #00ff66;

    font-family: "Courier New", monospace;

    font-size: 14px;

    z-index: 10000;

    overflow: hidden;

    transform-origin: center;
}


/*
   IMPORTANT:

   The boot screen is visible by default.

   This prevents the desktop from appearing
   for even a fraction of a second.
*/

.boot-screen.hidden {
    display: none;
}


.boot-line {
    margin-bottom: 5px;
}


.boot-screen.crt-on {
    animation:
        crtTurnOn 1s ease-out forwards;
}

@keyframes crtTurnOn {

    0% {
        transform: scaleY(.01);

        filter: brightness(2);
    }

    25% {
        transform: scaleY(.01);

        filter: brightness(2);
    }

    55% {
        transform: scaleY(1);

        filter: brightness(2);
    }

    70% {
        filter: brightness(.6);
    }

    82% {
        filter: brightness(1.5);
    }

    100% {
        transform: scaleY(1);

        filter: brightness(1);
    }
}


.boot-screen.crt-off {
    animation:
        crtTurnOff .9s ease-in forwards;
}

@keyframes crtTurnOff {

    0% {
        transform: scaleY(1);

        filter: brightness(1);
    }

    25% {
        filter: brightness(1.7);
    }

    55% {
        filter: brightness(2);

        transform: scaleY(.02);
    }

    75% {
        transform: scaleY(.02);

        filter: brightness(1);
    }

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



.boot-screen.powered-off {
    display: flex;

    transform: scaleY(1);

    background: #000;

    color: #000;

    animation: none;

    cursor: pointer;
}


.off-power {

    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(
        -50%,
        -50%
    );

    color: #111;

    font-family: Arial, sans-serif;

    font-size: 38px;

    opacity: .15;

    animation:
        powerFlicker 2.5s infinite;

}


/*
   Slow irregular CRT power light flicker.
*/

@keyframes powerFlicker {

    0% {
        opacity: .08;
    }

    10% {
        opacity: .2;
    }

    12% {
        opacity: .05;
    }

    25% {
        opacity: .15;
    }

    27% {
        opacity: .04;
    }

    40% {
        opacity: .18;
    }

    41% {
        opacity: .07;
    }

    60% {
        opacity: .13;
    }

    75% {
        opacity: .04;
    }

    85% {
        opacity: .2;
    }

    100% {
        opacity: .08;
    }
}


.crt-flicker {
    animation:
        flicker .12s linear 4;
}

@keyframes flicker {

    0% {
        opacity: 1;
    }

    25% {
        opacity: .65;
    }

    50% {
        opacity: 1;
    }

    75% {
        opacity: .35;
    }

    100% {
        opacity: 1;
    }
}


.browser-bar {
    display: flex;

    gap: 5px;

    margin-bottom: 7px;
}

.browser-bar input {
    flex: 1;

    padding: 4px;

    border: 2px inset #aaa;
}

.browser-bar button {
    padding: 3px 9px;

    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #fff
        #404040
        #404040
        #fff;

    cursor: pointer;
}

.browser-page {
    height: calc(100% - 37px);

    padding: 15px;

    overflow: auto;

    background: white;

    border: 2px inset #aaa;
}

.unavailable {
    margin-top: 55px;

    text-align: center;

    font-family: monospace;
}


.notepad {
    width: 100%;
    height: 100%;

    resize: none;

    padding: 5px;

    background: white;
    color: black;

    border: 2px inset #aaa;

    outline: none;

    font:
        13px "Courier New",
        monospace;
}


.files div {
    padding: 6px;

    border-bottom:
        1px dotted #aaa;
}



.ide {
    height: 100%;

    display: flex;

    flex-direction: column;

    gap: 5px;
}

.ide-top {
    display: flex;

    gap: 5px;
}

.ide-name {
    flex: 1;

    padding: 4px;

    border: 2px inset #aaa;

    font: 12px monospace;
}

.ide-top button {
    padding: 3px 8px;

    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #fff
        #404040
        #404040
        #fff;

    cursor: pointer;
}

.code {
    flex: 1;

    width: 100%;

    resize: none;

    padding: 8px;

    background: #111;

    color: #ddd;

    border: 2px inset #aaa;

    outline: none;

    font:
        13px Consolas,
        monospace;
}



.controls {
    width: 145px;

    display: flex;

    flex-direction: column;

    align-items: center;

    padding-top: 25px;
}

.brand {
    margin-bottom: 45px;

    color: #292722;

    font-size: 25px;

    font-weight: bold;

    letter-spacing: 3px;
}

.speaker {
    width: 100px;
    height: 170px;

    margin-top: 30px;

    opacity: .7;

    background:
        repeating-linear-gradient(
            to bottom,
            #292722 0 3px,
            transparent 3px 8px
        );
}


.scanlines {
    position: absolute;

    inset: 0;

    pointer-events: none;

    z-index: 5000;

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,.025) 0,
            rgba(255,255,255,.025) 1px,
            rgba(0,0,0,.08) 2px,
            rgba(0,0,0,.08) 4px
        );
}


@media(max-width: 900px) {

    .computer {
        padding: 15px;
        gap: 10px;
    }

    .controls {
        width: 110px;
    }

    .window {
        width: 360px;
        height: 250px;
    }
}

@media(max-width: 650px) {

    .controls {
        display: none;
    }

    .computer {
        padding: 10px;
    }

    .boot-screen {
        padding: 20px;
        font-size: 11px;
    }
}
