@font-face {
    font-family: "Montserrat";
    font-weight: 400;
    src: url("fonts/montserrat/Montserrat-Regular.woff2") format("woff2"),
        url("fonts/montserrat/Montserrat-Regular.woff") format("woff"),
        url("fonts/montserrat/Montserrat-Regular.ttf") format("ttf");
}

@font-face {
    font-family: "Work Sans";
    font-weight: 400;
    src: url("fonts/worksans/WorkSans-Regular.woff2") format("woff2"),
        url("fonts/worksans/WorkSans-Regular.woff") format("woff"),
        url("fonts/worksans/WorkSans-Regular.ttf") format("ttf");
}

@keyframes wisdom-resource-rotate {
    0%{
        transform: rotate(0deg);
    }
    100%{
        transform: rotate(-360deg);
    }
}

/*Main*/

body{
    font-size: 18px;
    font-family: "Work Sans", sans-serif;
    margin: 0;
    padding: 0;
    user-select: none;
    height: 100vh;
    background-color: #fafafa;

    overflow-y: hidden;
    overscroll-behavior: contain;
}

div#app{
    display: grid;
    grid-template-rows: 8vh 84vh 8vh;
}

article{
    padding: 0.5rem;
}

button{
    background-color: #cfcfcf;
    border: none;
    font-size: 110%;
    outline: 0;
}

button:hover:not(disabled){
    background-color: #b6b6b6;
}

button:disabled{
    opacity: 0.7;
}

header{
    padding: 0;
}

header h1, header span{
    font-size: 4vh;
}

header, footer{
    background-color: #e6e6e6;
    padding: 0.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

footer{
    justify-content: left;
}

h1, h2, h3, h4, h5, h6{
    font-family: Montserrat, sans-serif;
    margin: 0;
}

/*Inline Images*/

img.inline{
    height: 1em;
    display: inline;
}

.inline-resource{
    display: inline-flex;
    align-items: center;
}

.inline-resource img{
    margin-right: 0.2em;
    margin-left: 0.2em;
}

img[src="Images/wisdom.png"]{
    animation: wisdom-resource-rotate 1s infinite;
    animation-timing-function: linear;
}

/*For Damage Info*/

.red{
    color: #a90500;
}

canvas#cache{
    display: none;
}

main article.main{
    display: grid;
    padding: 1.5em;
    grid-template-columns: 45vw auto;
    grid-template-rows: 45vh auto;
}

/*Mine Object*/

div.mineobject{
    display: grid;
    grid-template-columns: 3em auto 3em;
    text-align: center;
    font-size: 140%;
}

div.mineobject p{
    line-height: 0.2em;
}

div.mineobject h2{
    font-size: 150%;
}

div.mine-object h2{ /*Mine Object Name*/
    white-space: nowrap;
}

canvas.mine-object{
    height: 6em;
    transition: filter 200ms, transform 200ms;
}

canvas.mine-object:active:not(.nodmg){
    filter: brightness(0.75);
    transform: scale(0.925);
}

div.mineobject > button{
    width: 2.5em;
    height: 2.5em;
    margin-top: 2.5em;
}

.changemineobj, .changemineobj:hover, .chapter-control button{
    background-color: transparent;
}

.changemineobj img.left, .craft-pickaxe img.left, .chapter-control img.left{
    transform-origin: left;
}

.changemineobj img.right, .craft-pickaxe img.right, .chapter-control img.right{
    transform-origin: right;
}

.changemineobj img, .chapter-control img{
    width: 100%;
    transition: transform 250ms, filter 250ms;
}

.changemineobj img:hover, .craft-pickaxe img.level-change:hover, .chapter-control img:hover{
    transform: scaleX(0.85);
}

.changemineobj img:active, .craft-pickaxe img.level-change:active, .chapter-control img:active{
    transform: scaleX(0.7);
    filter: brightness(0.9);
}

/*Stats*/

.stats{
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.stats .resources{
    font-size: 80%;
}

.stats p{
    margin: 0.5em 0;
}

/*Message Log*/

.messagelog{
    height: 6.5em;
    font-size: 80%;
    border: 1px solid black;
    overflow-y: scroll;
    margin: 0 1rem;
    padding: 0.25rem;
}

.messagelog p{
    margin: 0;
}

/*Crafting*/

.craft-pickaxe{
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.craft-pickaxe button{
    margin: 0 1rem;
}

.craft-pickaxe button.level-change{
    background-color: transparent;
    min-width: 3.75rem;
}

.craft-pickaxe img.level-change{
    height: 3rem;
    transition: filter 200ms, transform 200ms;
}

/*Upgrades*/

.upg-tabs{
    width: 100%;
    display: flex;
    justify-content: center;
}

.upg-tabs button{
    margin: 0 1rem;
}

.upgradelist-wrapper{
    display: flex;
    justify-content: center;
}

.upgradelist{
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
    width: 100%;
}

.upgrade{
    background-color: #fbfdff;
    margin: 3%;
    padding: 0.4em;
    padding-bottom: 1.05em;
    display: inline-block;
    font-size: 75%;
    cursor: pointer;
    text-align: center;
    border: 2px solid black;
    border-radius: 3px;
    position: relative;
}

.upgrade.gem{
    background-color: #9be5f2;
}

.upgrade.gem:hover{
    background-color: #7dbbc6 !important;
}

.upgrade.pc{
    background-color: #9596f2;
}

.upgrade.pc:hover{
    background-color: #7c7dce !important;
}

.upgrade .lvl{
    position: absolute;
    right: 0.2rem;
    bottom: 0;
    font-weight: bold;
}

.upgrade.cantafford{
    opacity: 0.3;
    cursor: auto;
}

.upgrade:hover:not(.cantafford){
    background-color: #e2e4e6;
}

.upgrade img{
    height: 4em;
}

.highlightedupgrade{
    line-height: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.highlightedupgrade .multibuy{
    color: #505050;
    font-size: 80%;
}

.highlightedupgrade .multibuy.active{
    color: #00bc00;
}

/*Standalone Upgrade*/

.upgrade-standalone p{
    margin: 0.15em 0;
}

.upgrade-standalone .description{
    font-size: 70%;
}

/*Powers*/

.powers p{
    padding: 0 1em;
}

p.wisdom{
    font-size: 150%;
    text-align: center;
}

.powers-table{
    font-size: 130%;
    margin: auto;
}

.powers-table td{
    border: 1px solid black;
    padding: 0.2em;
    padding-left: 0.5em;
}

.powers-table td:nth-child(2){
    min-width: 6em;
}

.powers-upgrades{
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-right: 1em;
    overflow-y: scroll;
    height: 30vh;
}

.powers-upgrades > .upgrade-standalone{
    margin: 1em;
    width: 40%;
}

/*Settings*/

article.settings{
    padding: 0.5rem;
}

article.settings button{
    margin: 0.5em;
    font-family: "Work Sans", Helvetica, Arial, sans-serif;
}

article.settings textarea{
    width: 50%;
    height: 10rem;
}

/*Story*/

article.story{
    padding: 1rem;
    z-index: -1;
}

.story-milestones{
    overflow-y: scroll;
    overscroll-behavior: contain;
    height: 62vh;
}

.story .objective{
    border-top: 1px solid rgba(0, 0, 0, 0.4);
    margin: 0;
    padding-top: 0.5rem;
}

article.story div.story-milestones > div{
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

article.story div.story-milestones > div:last-child{
    border-bottom: none;
}

article.story div img{
    height: 6em;
}

.story-quote{
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
}

.story-quote span{
    margin-left: 2rem;
    font-size: 3rem;
    color: #404040;
    font-style: italic;
    font-family: "Times new Roman", serif;
}

.chapter-control{
    display: flex;
    width: 100%;
    justify-content: space-between;
    height: 4rem;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

.chapter-control h3{
    font-size: 2rem;
}

.chapter-control button, .chapter-control button img{
    height: 3rem !important;
    width: 3rem !important;
}

/*Social*/

.social{
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 9vh;
    left: 0;
}

.social span{
    margin-right: 1rem;
}

.social a{
    margin: 0 0.5rem;
}

.social a img{
    height: 2rem;
}

.story-tab{
    position: relative;
}

.story-tab img.notification{
    margin-right: 0.9rem;
}

.story-tab span.notification{
    position: absolute;
    left: 1.5rem;
    bottom: 0.2rem;
    background-color: red;
    color: white;
    border-radius: 100%;
    padding: 0.17vh;
    min-width: 2vh;
    height: 2vh;
    font-size: 1.9vh;
}

footer{
    padding: 1vh;
}

footer button{
    background-color: white;
    color: black;
    min-width: 5vh;
    height: 5vh;
    font-size: 3vh;
    margin: 0.5vh;
    padding: 0.2vh 0.5rem;
    display: flex;
    align-items: center;
}

footer button img, footer button span{
    padding: 0;
    margin: 0;
    margin-right: 0.5rem;
}

footer button:hover{
    background-color: rgb(222, 222, 222);
}

/*
@media (max-width: 1300px)
{
    header{
        height: 3vh;
    }

    header h1, header span{
        font-size: 2.5vh;
    }

    body{
        font-size: 0.7em;
    }

    div.stats{
        font-size: 1em;
    }
}*/