:root {
    --dark-col: #0F0717;
    --light-col: #201035; /*201035 24123B*/
}

* {
    margin:0;
    padding:0;
    color: #fff;
    font-weight: 400;
}

html {
    height: 100%;
}

body {
    display: block;
    height: 100%;
    background: var(--dark-col);
    background: linear-gradient(0deg, var(--dark-col) 0%, var(--light-col) 100%);
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, span {
    font-family: 'Press Start 2P', cursive;
    user-select: none;
}

section.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0vh;
    opacity: 1;
    transition: opacity .6s .6s, top .1s .0s;
}

section.hidden {
    transition: opacity .6s 0s, top .1s .6s;
    top: -100vh;
    opacity: 0;
}

#titleScreen h1 {
    font-size: 2.4em;
    padding-bottom: 25px;
}

#titleScreen #beginLamp {
    cursor: pointer;
    transform: translateY(25px);
    animation-name: lightBounce;
    animation-duration: 8s;
    animation-iteration-count: infinite;
    animation-timing-function: cubic-bezier(0.65, 0.05, 0.36, 1);
}

@keyframes lightBounce {
    0% {transform: translateY(25px);}
    50% {transform: translateY(0px);}
    100% {transform: translateY(25px);}
}

#titleScreen #beginLamp img {
    width: 120px;
    image-rendering: pixelated;
    z-index: 2;
    position: relative;
}

#titleScreen #beginLamp h5 {
    text-align: center;
    padding-top: 4px;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform .6s, opacity .6s;
}

#titleScreen #beginLamp:hover h5 {
    transform: translateY(0px);
    opacity: 1;
}

#titleScreen #begin {
    margin-top: 25px;
    cursor: pointer;
    padding: 14px;
    background-image: url('./../assets/game-over-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    transition: transform .5s;
}

#titleScreen #begin:hover {
    transform: scale(1.06);
}

#introScreen p {
    padding: 0 20px;
    max-width: 800px;
    text-align: center;
    line-height: 1.6em;
}

#introScreen #continue {
    margin-top: 25px;
    cursor: pointer;
    padding: 14px 26px;
    background-image: url('./../assets/game-over-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    transition: transform .5s;
}

#introScreen #continue:hover {
    transform: scale(1.06);
}

#instructions .container {
    display: flex;
    flex-wrap: wrap;
    width: 95%;
    border: 2px solid #ffffff80;
}

#instructions .container .col-6 {
    width: calc(100% / 3);
    padding: 12px 12px 12px 12px;
    box-sizing: border-box;
    border: 2px solid #8d8695;
    box-shadow: 0 0 0 1px #8d8695;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

#instructions .container .col-6 p {
    text-align: center;
    line-height: 1.6em;
}

#instructions .container .col-6 img {
    width: 105px;
    image-rendering: pixelated;
}

#instructions .container .col-6 .movementContainer {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

#instructions .container .col-6 .movementContainer > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#instructions .container .col-6 .movementContainer > div > div {
    display: flex;
    justify-content: center;
}

#instructions .container .col-6 .movementContainer > div > div > span {
    border: 2px solid #fff;
    padding: 2px;
    display: inline-block;
    font-size: 1.6em;
}

#instructions .container .col-6 .movementContainer .arrows .up {
    width: 100%;
}

#instructions .container .col-6 .movementContainer .arrows .up span {
    transform: rotate(90deg);
}

#instructions .container .col-6 .movementContainer .arrows .down span {
    transform: rotate(-90deg) scaleY(-1);
}

#instructions .container .col-6 .movementContainer .wasd .up {
    width: 100%;
}

#instructions .container .col-6 .tutMeter {
    width: 20px;
    height: 85px;
    border: 2px solid;
    margin-bottom: 10px;
    padding: 2px;
    box-sizing: border-box;
    transform: rotate(180deg);
}

#instructions .container .col-6 .tutMeter .tutOil {
    height: 15%;
    width: 100%;
    background-color: #fbd64e;
}

#instructions #levelSelect {
    margin-top: 25px;
    cursor: pointer;
    padding: 14px 26px;
    background-image: url('./../assets/game-over-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    transition: transform .5s;
}

#instructions #levelSelect:hover {
    transform: scale(1.06);
}

#levelSelection .container {
    display: flex;
    flex-wrap: wrap;
    width: 95%;
    border: 2px solid #ffffff80;
}

#levelSelection .container .col-6 {
    width: calc(100% / 3);
    padding: 12px 12px 12px 12px;
    box-sizing: border-box;
    border: 2px solid #8d8695;
    box-shadow: 0 0 0 1px #8d8695;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: box-shadow .5s;
}

#levelSelection .container .col-6.selected {
    box-shadow: 0 0 0 1px #8d8695, inset 0 0 0 4px #fff;
}

#levelSelection .container .col-6 p {
    text-align: center;
    line-height: 1.6em;
    font-size: 1.1em;
}

#levelSelection .container .col-6 img {
    width: 80%;
    image-rendering: pixelated;
    transition: transform .5s;
}

#levelSelection .container .col-6 img.levelMobile {
    display: none;
}

#levelSelection .container .col-6:hover img {
    transform: scale(1.1);
}

#levelSelection .container .col-6 .description {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #0f07177c;
    opacity: 0;
    transition: opacity .5s, box-shadow .5s;
}

#levelSelection .container .col-6.selected .description {
    box-shadow: 0 0 0 1px #8d8695, inset 0 0 0 4px #fff;
}

#levelSelection .container .col-6:hover .description {
    opacity: 1;
}

#levelSelection .container .col-6 .description p {
    font-size: 0.9em;
}

#levelSelection #startGame {
    margin-top: 25px;
    cursor: pointer;
    padding: 14px 26px;
    background-image: url('./../assets/game-over-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    transition: transform .5s, opacity .5s;
}

#levelSelection #startGame.disabled {
    opacity: .4;
    pointer-events: none;
}

#levelSelection #startGame:hover {
    transform: scale(1.06);
}

#levelSelection #startGame h5 {
    pointer-events: none;
}

#canvasSection {
    position: relative;
}

#canvasSection #playPause, #canvasSection #soundMute, #canvasSection #exit {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 2;
}
#canvasSection #soundMute {
    left: 62px;
}
#canvasSection #exit {
    left: 108px;
}

#canvasSection #playPause.play {
    background-image: url('./../assets/pause.png');
}

#canvasSection #playPause.pause {
    background-image: url('./../assets/play.png');
}

#canvasSection #soundMute.sound {
    background-image: url('./../assets/sound.png');
}

#canvasSection #soundMute.mute {
    background-image: url('./../assets/mute.png');
}

#canvasSection #exit {
    background-image: url('./../assets/exit.png');
    transition: opacity .2s;
}

#canvasSection #exit.exitHide {
    opacity: 0;
    cursor: unset;
    pointer-events: none;
}

#canvasSection .overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0f0717c7;
    z-index: 1;
    pointer-events: none;
    transition: opacity .2s;
    opacity: 0;
}

#canvasSection #gameOver.overlay {
    flex-direction: column;
    background-color: #0f0717;
    z-index: 3;
    transition: opacity .5s, margin 1s;
}

#canvasSection .show {
    opacity: 1;
    pointer-events: unset;
}

#canvasSection .overlay h2 {
    font-size: 2em;
    user-select: none;
    transition: margin 1s;
}

#canvasSection #gameOver #tryAgain {
    position: absolute;
    transform: translateY(85px);
    margin-top: 25px;
    cursor: pointer;
    padding: 14px;
    background-image: url('./../assets/game-over-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    opacity: 0;
    transition: margin 1s, opacity 1s, transform .5s;
}

#canvasSection #gameOver #tryAgain.show {
    opacity: 1;
    margin-top: 0px;
}

#canvasSection #gameOver #tryAgain:hover {
    transform: translateY(85px) scale(1.06);
}

#canvasSection #gameOver #tryAgain h5 {
    font-size: 1.2em;
}

#canvasSection #bedTime {
    pointer-events: none;
    flex-direction: column;
    background-color: #0f071740;
    transition: opacity 2s;
}

#canvasSection #bedTime > div {
    position: absolute;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
    margin-top: 60vh;
    opacity: 0;
    transition: margin 2s, opacity 2s;
}

#canvasSection #bedTime > div.show {
    margin-top: 0vh;
    opacity: 1;
}

#canvasSection #bedTime > div.hide {
    margin-top: -60vh;
    opacity: 0;
}

#canvasSection .mobileControl {
    display: none;
}

#canvasSection .oilCont {
    position: absolute;
    right: 10px;
    top: 10px;
}

#canvasSection .oilCont .oilJar {
    width: 20px;
    height: 100px;
    border: 2px solid;
    margin: 8px auto;
    padding: 2px;
    box-sizing: border-box;
    transform: rotate(180deg);
}

#canvasSection .oilCont .oilJar .oil {
    height: 100%;
    width: 100%;
    background-color: #fbd64e;
}

#canvasSection canvas {
    /*border: 1px solid red;*/
    background-color: var(--dark-col);
}

#winScreen {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#winScreen.hide {
    transition: opacity 1s;
    opacity: 0;
}

#winScreen .winOverlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--dark-col);
    opacity: 0;
    transition: opacity 3s 0s, background-color 3s 4s ease-in;
}

#winScreen .winOverlay.day {
    transition: opacity 2s 0s, background-color 3s 4s ease-in;
    opacity: 1;
    background-color: #fff86a;
}

#winScreen .winImage {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('./../assets/win-screen-eyes-closed.png'), url('./../assets/win-screen.png');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    image-rendering: pixelated;
    display: none;
}

#winScreen .winImage.open {
    background: url('./../assets/win-screen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#winScreen .winImage #playAgain, #winScreen .winImage #levelReSelect {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 25px;
    cursor: pointer;
    pointer-events: all;
    padding: 14px;
    background-image: url('./../assets/game-over-border.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    opacity: 0;
    transition: margin 1s, opacity 1s, transform .5s;
}

#winScreen .winImage #levelReSelect {
    top: 58%;
    transform: translate(-50%, -50%) scale(0.8);
}

#winScreen .winImage #playAgain.show, #winScreen .winImage #levelReSelect.show {
    opacity: 1;
    margin-top: 0px;
}

#winScreen .winImage #playAgain:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

#winScreen .winImage #levelReSelect:hover {
    transform: translate(-50%, -50%) scale(0.86);
}

#winScreen .winImage #playAgain h5, #winScreen .winImage #levelReSelect h5 {
    font-size: 1.2em;
}

.ghLink {
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: .2;
    z-index: 9999;
    transform: scale(1);
    transition: transform .3s, opacity .3s;
}

.ghLink:hover {
    opacity: .6;
    transform: scale(1.1);
}

.ghLink img {
    image-rendering: pixelated;
    width: 35px;
}

@media all and (max-width: 840px) {
    #canvasSection .mobileControl {
        display: block;
        position: absolute;
        right: 50%;
        bottom: 15px;
        transform: translateX(50%);
    }

    #canvasSection .mobileControl > div {
        display: flex;
        justify-content: space-between;
    }

    #canvasSection .mobileControl > div > div {
        padding: 6px;
    }

    #canvasSection .mobileControl > div > div > span,
    #canvasSection .mobileControl > div > div > img {
        font-size: 1.8em;
        display: inline-block;
        user-select: none;
        pointer-events: none;
        opacity: 0.6;
    }

    #canvasSection .mobileControl > div > #joystick {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #canvasSection .mobileControl > div > #joystick > img {
        opacity: 1;
        width: 100%;
        image-rendering: pixelated;
    }

    #canvasSection .mobileControl > div > #upLeft > span {
        transform: rotate(-45deg);
    }
    #canvasSection .mobileControl > div > #upRight > span {
        transform: rotate(45deg);
    }
    #canvasSection .mobileControl > div > #left > span {
        transform: rotate(-90deg);
    }
    #canvasSection .mobileControl > div > #right > span {
        transform: rotate(-90deg);
    }
    #canvasSection .mobileControl > div > #downLeft > span {
        transform: rotate(45deg);
    }
    #canvasSection .mobileControl > div > #downRight > span {
        transform: rotate(-45deg);
    }

    #titleScreen h1 {
        font-size: 1.4em;
    }

    #titleScreen #beginLamp img {
        width: 100px;
    }

    #titleScreen #beginLamp h5 {
        transform: translateY(0px);
        opacity: 1;
    }

    #introScreen p,
    #instructions .container .col-6 p {
        font-size: 0.6em;
    }

    #canvasSection .overlay h2 {
        font-size: 1em;
    }

    #instructions .container {
        margin-top: 20px;
    }

    #instructions .container .col-6 {
        width: calc(100% / 2);
        padding: 8px;
    }

    #instructions .container .col-6 img {
        width: 70px;
    }

    #instructions .container .col-6 .movementContainer > div > div > span {
        font-size: 0.8em;
    }

    #instructions #levelSelect {
        margin-bottom: 20px;
    }

    #levelSelection .container {
        margin-top: 20px;
        width: 70%;
    }

    #levelSelection .container .col-6 {
        width: 100%;
        padding: 12px 2px;
    }

    #levelSelection .container .col-6 img.levelDesktop {
        display: none;
    }
    #levelSelection .container .col-6 img.levelMobile {
        display: block;
        width: 100%;
    }

    #levelSelection .container .col-6 p {
        font-size: 0.8em;
    }

    #levelSelection .container .col-6 .description p {
        font-size: 0.6em;
    }

    #levelSelection #startGame {
        margin-bottom: 20px;
    }

    #winScreen .winImage {
        background: url(./../assets/win-screen-eyes-closed-mobile.png), url(./../assets/win-screen-mobile.png);
        background-size: cover, cover;
        background-position: center, center;
        background-repeat: no-repeat, no-repeat;
    }

    #winScreen .winImage.open {
        background: url(./../assets/win-screen-mobile.png);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    #winScreen .winImage #playAgain, #winScreen .winImage #levelReSelect {
        width: fit-content;
    }

    #winScreen .winImage #playAgain h5, #winScreen .winImage #levelReSelect h5 {
        font-size: 1em;
    }
}