
body {
    margin: 0;
    padding: 0;
    background-color: #ccc;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow: hidden;
}

.fight-board {
    position: fixed;
    top: 15%;
    left: calc(50% - 250px);
    width: 500px;
    height: 350px;
    /* display: flex; */
    flex-wrap: wrap;
    display: none;
}

.fight-board.open {
    display: flex;
}

.background-board {
    height: 150px;
    width: 100%;
    background-color: green;
    transform: perspective(150px) rotateX(-15deg);
    margin-bottom: -27px;
    background-image: url(gfx/flight-wall.png);
}


.scewed-board {
    height: 200px;
    width: 100%;
    display: flex;
    background-image: url(gfx/flight-floor.png);
    transform: perspective(150px) rotateX(10deg);
}

.enemy-side {
    width: 50%;
    position: relative;
}

.friend-side {
    width: 50%;
}

.board-menu {
    width: 100%;
    height: 100px;
    background-image: url(gfx/fight-bottom.png);
    flex-basis: 100%;;
    transform: perspective(340px) rotateX(-51deg);
    margin-top: -4px;
    box-sizing: border-box;
    padding-right: 6px;
}

.board-menu .option.take-potion {
    padding: 7px 4px;
    margin: 25px 10px 0 auto;
    cursor: pointer;
    background-color: #a57855;
    width: 180px;
    font-size: 0.8rem;
    text-align: center;
    border: 2px solid #593e47;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    border-radius: 2px;
}

.board-menu .option.take-potion:hover {
    background-color: #593e47;
    color: #fff;
}

.enemy-side .enemy {
    height: 50px;
    width: 50px;
    position: absolute;
    background-image: url(gfx/goblin01.png);
    cursor: pointer;
    transition: all 0.1s;
}

.enemy-side .enemy:hover {
    background-image: url(gfx/goblin01-hover.png);
}

.enemy-side .enemy.no1 {
    top: 5px;
    left: 65px;
}

.enemy-side .enemy.no0 {
    top: 70px;
    left: 100px;
}

.enemy-side .enemy.no2 {
    top: 120px;
    left: 45px;
}

.enemy.attacked {
    margin-left: -3px;
}

.enemy.attacking {
    margin-left: 50px;
}


.friend-side .player {
    height: 50px;
    width: 50px;
    background-image: url(gfx/main-guy.png);
    position: relative;
    transition: all 0.1s;
    left: 0;
}

.friend-side .player.attacked {
    left: 3px;
}

.friend-side .player.attacking {
    left: -40px;
}

.friend-side .player:nth-of-type(1) {
    margin-top: 70px;
    margin-left: calc(100% - 130px);
    /* transform: perspective(150px) rotateX(-15deg); */
}

.hp {
    position: absolute;
    pointer-events: none;
    text-align: center;
    font-size: 0.6rem;
    width: 100%;
    text-align: center;
    bottom: 0;
    z-index: 1;
    text-shadow: 1px 1px 1px black;
    color: #fff;
}

.hp-bar {
    position: absolute;
    z-index: -1;
    bottom: 0;
    background: red;
    width: 100%;
    height: 3px;
    transition: all 0.3s;
    border-radius: 1px;
    box-shadow: 0px 0px 0px 2px #000;
}




.dialog-box {
    position: fixed;
    bottom: 15px;
    left: 0;
    right: 0;
    margin: auto;
    height: 100px;
    width: 100%;
    max-width: 800px;
    display: none;
    z-index: 1;
    cursor: pointer;
    font-size: 1.1rem;
    background-image: url(gfx/dialog-bg.png);
}

.dialog-box.open {
    display: block;
}

.dialog-box .you,
.dialog-box .them {
    display: flex;
    margin-bottom: 20px;
}

.dialog-box .you {
    flex-direction: row-reverse;
}

.dialog-box .avatar {
    height: 100px;
    min-width: 100px;
}

.dialog-box .you.avatar {
    background-image: url(gfx/you-avatar.png);
}

.dialog-box .castleMan {
    background-image: url(gfx/king-avatar.png);   
}

.dialog-box .soldier {
    background-image: url(gfx/soldier-avatar.png);   
}

.dialog-box .voidBoss {
    background-image: url(gfx/void-avatar.png);   
}

.dialog-box .guide {
    background-image: url(gfx/guide-avatar.png);   
}

.dialog-box .goblin {
    background-image: url(gfx/goblin-avatar.png);   
}

.dialog-box .text {
    margin: 20px 5px 5px 5px;
    color: #fff;
}
.them .text {
    margin-right: 50px;
}

.fight-results-board {
    position: fixed;
    top: 15%;
    left: calc(50% - 175px);
    width: 350px;
    height: 300px;
    background-color: #a57855;
    color: #fff;
    font-weight: bold;
    display: none;
    border-radius: 2px;
    /* justify-content: space-between; */
    text-transform: uppercase;
    border: 10px solid #593e47;
}

.fight-results-board.open {
    display: block;
}

.fight-results-board .header {
    text-align: center;
    padding: 15px;
    font-size: 2rem;
}

.fight-results-board .wrapper {
    display: flex;
    padding: 10px 50px;
    justify-content: space-between;    
}

.fight-results-board .btn-continue {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    width: 130px;
    padding: 9px 11px;
    background-color: #a57855;
    margin: auto;
    text-align: center;
    cursor: pointer;
    border: 3px solid #593e47;
    letter-spacing: 1px;
    border-radius: 2px;
}

.fight-results-board .btn-continue:hover {
    background: #593e47;
}


.castle-ui {
    position: fixed;
    top: 15%;
    left: calc(50% - 250px);
    width: 500px;
    height: 300px;
    /* background-color: #fff; */
    background-image: url(gfx/ui-bg-castle.png);
    display: none;
    justify-content: space-between;
    overflow: hidden;
}

.castle-ui.open {
    display: flex;
}

.castle-left-menu,
.castle-right-menu {
    padding: 30px;
    width: 210px;
    height: 100%;
    /* background-color: #ccc; */
    box-sizing: border-box;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    color: #fff;
}

.castle-ui .menu-option {
    padding: 4px 7px;
    margin: 10px 0;
    /* background: lime; */
    border: 3px solid #593e47;
    cursor: pointer;
    border-radius: 2px;
}

.castle-ui .menu-option:hover {
    background: #593e47;
    /* border-color: #fff; */
    /* color: #a57855; */
}

.castle-ui .menu-option.disabled {
    opacity: 0.2;
}
.castle-ui .menu-option.disabled:hover {
    background: unset;
    cursor: auto;
}

.castle-ui .close-ui {
    position: absolute;
    top: 0;
    right: 0;
    height: 30px;
    width: 30px;
    background-image: url(gfx/ui-x.png);
    cursor: pointer;
}

.castle-ui .close-ui:hover {
    background-image: url(gfx/ui-x-hover.png);
}

.top-menu {
    position: fixed;
    top: -50px;
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.top-menu.open {
    top: 0;
}

.void-timer {
    width: 54px;
    height: 44px;
    padding: 6px 5px 3px 5px;
    background-image: url(gfx/voidtime-counter.png);
    font-size: 1.7rem;
    font-weight: bold;
    margin-left: 100px;
    color: #fff;
    box-sizing: border-box;
}

.void-inventory {
    height: 25px;
    width: 50px;
    color: #fff;
    background-color: #7a5759;
    border: 2px solid #593e47;
    z-index: -1;
    margin-left: -10px;
    text-align: right;
    padding-top: 2px;
    box-sizing: border-box;
    font-size: 0.9rem;
    font-weight: bold;
}

.void-inventory::after {
    content: '';
    display: inline-block;
    height: 16px;
    width: 16px;
    background-image: url(gfx/void-coin.png);
    vertical-align: -2px;
    margin-left: 2px;
}

.sleep-animation {
    position: fixed;
    z-index: 4;
    height: 100%;
    width: 100%;
    pointer-events: none;
    /* background-color: lime; */
}

.sleep-animation.open {
    animation: fade 2s;
}

@keyframes fade {
    0%, 100% {
        background-color: transparent;
    }
    80% {
        background-color: #000;
    }
}

.sleep-animation .sleep-top,
.sleep-animation .sleep-bottom {
    height: 0%;
    width: 100%;
    position: absolute;
    background-color: #000;
}


.sleep-animation .sleep-top {
    top: 0;
    /* height: 50%; */
    /* background-color: blue; */
    /* animation: openTop 1s; */
    /* animation-fill-mode: forwards; */
}



.sleep-animation .sleep-bottom {
    bottom: 0;
    /* background-color: pink; */
    /* animation-fill-mode: forwards; */
}

.open .sleep-top {
    animation: openTop 2s;
    animation-timing-function: ease-in-out;
}

.open .sleep-bottom {
    animation: openBottom 2s;
    animation-timing-function: ease-in-out;

}

@keyframes openTop {
    0%, 100% {
        height: 0;
    }
    70%, 80% {
        height: 50%;
    }

}

@keyframes openBottom {
    0%, 100% {
        height: 0;
    }
    70%, 80% {
        height: 50%;
    }
}


.enemy-side .enemy.m-id0::before {
    content: '';
    background-image: url(gfx/pointing-hand.png);
    height: 25px;
    width: 25px;
    position: absolute;
    top: -32px;
    left: 10px;
    animation: pointing 0.5s infinite;
}
@keyframes pointing {
    50% {
        top: -42px;
    }
    0%, 100% {
        top: -32px;

    }
}


.enemy-side .enemy.void {
    background-image: url(gfx/void.png);
}

.enemy-side .enemy.void:hover {
    background-image: url(gfx/void-hover.png);
}

.enemy-side .enemy.wolf {
    background-image: url(gfx/wolf.png);
}

.enemy-side .enemy.wolf:hover {
    background-image: url(gfx/wolf-hover.png);
}

.enemy-side .enemy.firstBoss,
.enemy-side .enemy.secondBoss,
.enemy-side .enemy.thirdBoss {
    height: 90px;
    width: 90px;
    top: 50px;
    left: 90px;
}

.enemy-side .enemy.firstBoss {
    background-image: url(gfx/void-boss-1.png);
}

.enemy-side .enemy.firstBoss:hover {
    background-image: url(gfx/void-boss-1-hover.png);
}

.enemy-side .enemy.secondBoss {
    background-image: url(gfx/void-boss-2.png);
}

.enemy-side .enemy.secondBoss:hover {
    background-image: url(gfx/void-boss-2-hover.png);
}

.enemy-side .enemy.thirdBoss {
    background-image: url(gfx/void-boss-3.png);
}
.enemy-side .enemy.thirdBoss:hover {
    background-image: url(gfx/void-boss-3-hover.png);
}



.game-start-ui {
    background-color: #fff;
    background-image: url(gfx/intro-screen.png);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 920px;
    height: 518px;
    margin: auto;
    z-index: 1;
    opacity: 1;
    transition: all 1s;
    padding: 60px;
    box-sizing: border-box;
}

.game-start-ui h1 {
    margin: 0;
    color: #fff;
}

.game-start-ui .one {
    font-size: 2.5rem;
}
.game-start-ui .two {
    display: block;
    font-size: 1.6rem;
    margin: -10px 0 -18px 48px;
}
.game-start-ui .third {
    font-size: 3rem;
    display: block;
    margin-left: 10px;
}

.game-start-ui.fade-out {
    opacity: 0;
}

.btn-start-the-game {
    background-color: #a57855;
    padding: 8px 10px;
    cursor: pointer;
    margin-left: auto;
    width: 200px;
    color: #fff;
    text-align: center;
    border: 3px solid #593e47;
    font-size: 1.0rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 130px;
    border-radius: 2px;
}
.btn-start-the-game:hover {
    background-color: #593e47;
}

.intro-stage {
    position: fixed;
    background-color: #000;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    margin: auto;
    transition: all 1s ease;
}

.intro-stage.fade-out {
    opacity: 0;

}

.intro-stage #introCanvas {
    margin: auto;
    display: block;
}

.intro-text {
    transition: all 1s;
    opacity: 1;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 25px;
    margin: auto;
    text-align: center;
    font-size: 1.5rem;
    text-shadow: 0px 0px 5px #000;
    color: #fff;
}

.intro-text.fade {
    opacity: 0;
}

.research-tab {
    position: absolute;
    background-color: #593e47;
    height: 85%;
    width: 300px;
    padding: 10px;
    box-sizing: border-box;
    transition: all 0.3s;
    left: -330px;
    margin: 22px;
}

.research-tab.open {
    left: 0;
}

.research-tab .research-item {
    background-color: #a57855;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 10px;
    cursor: pointer;
    position: relative;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border: 3px solid #a57855;
    border-radius: 2px;
}

.research-tab .research-item:hover {
    background-color: #593e47;
}

.research-tab .research-desc {
    width: 100%;
    font-size: 0.8rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}

.research-cost {
    position: absolute;
    right: 10px;
    top: 17px;
}
.research-cost::after {
    content: '';
    height: 16px;
    width: 16px;
    display: inline-block;
    background-image: url(gfx/void-coin.png);
    margin-left: 4px;
    vertical-align: -2px;
}

.death-screen {
    position: fixed;
    width: 100%;
    height: 0%;
    top: 0;
    /* background-color: lime; */
    background-image: url(gfx/bg_fade_gradient.png);
    background-position-y: 100%;
    z-index: 6;
    overflow: hidden;
    transition: all 2s steps(10);
    text-align: center;
    font-weight: bold;
}

.death-screen.open {
    height: 140%;
    padding-top: 100px;

}

.death-head {
    color: #fff;
    font-size: 2rem;
    margin-top: 10px;
    text-transform: uppercase;
}

.death-text {
    font-size: 1.2rem;
    color: #fff;
    font-weight: normal;
    margin-top: 20px; 
}

.death-text span {
    color: red;
    font-size: 1.5rem;
    font-weight: bold;
    vertical-align: middle;
}

.btn-try-again {
    padding: 10px 15px;
    font-size: 1rem;
    color: #fff;
    background-color: #a57855;
    width: 100px;
    text-align: center;
    font-weight: bold;
    border: 3px solid #593e47;
    cursor: pointer;
    margin: 20px auto;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-try-again:hover {
    background-color: #593e47;
}

.end-credit {
    position: fixed;
    width: 100%;
    height: 0%;
    top: 0;
    background-image: url(gfx/bg_fade_gradient.png);
    background-position-y: 100%;
    z-index: 6;
    overflow: hidden;
    transition: all 2s steps(10);
    text-align: center;
    font-weight: bold;
}

.end-credit.open {
    height: 140%;
    padding-top: 60px;
}

.end-revive {
    color: red;
    font-size: 1.2rem;
    margin-top: 35px
}

.credit-head {
    color: #fff;
    font-size: 2rem;
    margin-top: 10px;
    text-transform: uppercase;
}

.credit-text {
    font-size: 1.2rem;
    color: #fff;
    font-weight: normal;
    margin-top: 20px;
}

.dialogue-span {
    color: #bbb;
}

#myCanvas.preventClick {
    pointer-events: none;
}


.boss-done #myCanvas {
    opacity: 0;
}

.boss-done .enemy.thirdBoss .hp {
    color: transparent;
    text-shadow: none;
}

.boss-done .enemy.thirdBoss:hover {
    background-image: url(gfx/void-boss-3.png);
}

.boss-done .enemy.thirdBoss .hp-bar {
    display: none;
}

body.boss-done,
.boss-done .board-menu,
.boss-done .background-board,
.boss-done .scewed-board {
    background: #000;
}

.boss-done .board-menu,
.boss-done .friend-side {
    opacity: 0;
}

.boss-done .enemy.thirdBoss::before {
    content: '';
    height: 80px;
    width: 80px;
    background-image: url(gfx/end-boss-slice.gif);
    background-repeat: no-repeat;
    position: absolute;
    top: -10px;
    right: -20px;
}


body.big-shake {
    animation: tilt-n-move-shaking 0.15s infinite;
  }

  @keyframes horizontal-shaking {
    0% { transform: translateX(0) }
    25% { transform: translateX(50px) }
    50% { transform: translateX(-50px) }
    75% { transform: translateX(50px) }
    100% { transform: translateX(0) }
   }

  @keyframes tilt-n-move-shaking {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, 10px) rotate(1deg); }
    50% { transform: translate(0, 0) rotate(0eg); }
    75% { transform: translate(-50px, 10px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
  }