:root
{
    --pixel-size: 4.5;
}

*
{
    touch-action: pan-y;
    overscroll-behavior: none;
}
/* Hide scrollbar for Chrome, Safari and Opera */


@font-face {
    font-family: '8bit'; /*a name to be used later*/
    src: url('fonts/8bitlim.ttf'); /*URL to font*/
}

body
{
    background-color: rgb(175, 175, 175);
    background-image: url("images/grass.png");
    background-size: 55%;

    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}
header
{
    font-family: '8bit', Times, serif;
    display: flex;
    min-height: 150px;
    background-color: rgba(255, 255, 255, 0.267);
    background-image: url("images/grass_patch.png");
    background-repeat: no-repeat;
    background-position: 50% 100%;
    background-size: calc(160px * var(--pixel-size));
    height: 15vh;
    padding: 1em;
}
main
{
    scroll-behavior: smooth;
    font-family: '8bit', Times, serif;
    font-size: x-large;
    background-color: rgb(255, 255, 255);
    height: 32vh;
    padding: 2em;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
main p:last-child 
{
    color: #202020;
    margin: 0;
    margin-bottom: .7em;
}
main p:not(:last-child)
{
    color: #adadad;
    margin: 0;
    margin-bottom: .7em;
}

/*.container > div > div:last-child*/
footer
{
    font-family: '8bit', Times, serif;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: rgb(255, 255, 255);
    height: 30vh;
    padding: 1em;
}
input[type=button], input[type=submit], input[type=reset]
{
        font-family: '8bit', Times, serif;
        font-size: larger;
        width: 100%;
        height: 3rem;
        margin-top: 3px;
        margin-bottom: 3px;
        background-color: #c7d8a8;
        -webkit-appearance: none;
        border-radius: 10px;
        border: 1px solid #384927;
        box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.404);
}
input[type=button]:disabled, input[type=submit]:disabled, input[type=reset]:disabled
{
        font-family: '8bit', Times, serif;
        font-size: larger;
        width: 100%;
        height: 3rem;
        margin-top: 3px;
        margin-bottom: 3px;
        background-color: #f3f3f3;
        -webkit-appearance: none;
        border-radius: 10px;
        border: 0px solid #384927;
        box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
}

.nonSelectable /*Disables annoying missclicks that make you select text instead of clicking a control*/
{
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.container
{
    margin: 0 auto;
    width: 95vw;
    max-width: 60rem;
    box-shadow: 1em 1em 2em rgba(0, 0, 0, 0.404);
}
.centered
{
    display: block;
    margin: auto auto;
    height: 90%;
}
.height100
{
    flex-grow: 1;
    height: 100%;
    width: 25rem;
    margin: 0.5rem;
}
.statWindow
{
    position: absolute;
    transform: translate3d(.2rem, 2rem, 0);
    flex-grow: 1;
    border-radius: 5px;
    height: 90%;
    width: 40vw;
    z-index: 1;
    max-width: 28rem;
}

.inventoryWindow
{
    opacity: 1;
    transition: opacity .2s, transform .2s;
    flex-grow: 1;
    border-radius: 5px;
    height: 90%;
    width: 25rem;
    margin: 1rem 0.2rem 0 0.2rem;
    overflow: auto;
    padding: 0.3rem 0.3rem 0.3rem 0.3rem;
    background-color: #ffffff;
    border: 1px solid #f3f3f3;
    z-index: 2;

    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.inventoryWindow::-webkit-scrollbar {
    display: none;
}
.inventoryWindow.fade {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
}

.actionsWindow
{
    flex-grow: 1;
    border: 1px solid rgb(230, 230, 230);
    border-radius: 5px;
    height: 90%;
    width: 25rem;
    margin: 1rem 0.2rem 0 0.2rem;
    overflow: auto;
    padding: 0.3rem 0.3rem 0.3rem 0.3rem;

    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.actionsWindow::-webkit-scrollbar {
    display: none;
}

#inventoryLabel
{
    display: block;
    margin: 0 auto;
    text-align: center;
    border-radius: 3px;
}

.menuLabel
{
    display: block;
    text-align: center;
    transform: translate(0.5em, -1.2em);
    background-color: rgb(255, 255, 255);
    position:absolute;
    padding: 0 5px 0 5px;
    border-radius: 5px;
    border: 1px solid #bbbbbb;
}
.title
{
    margin: 0 auto 0.1em auto;
    text-decoration: underline;
    text-align: center;
    font-size: small;
    transform: translateY(1.5em)
}
.itemIcon
{
    
    border-radius: 3px;
    margin: 3px -1em 3px -1em;
    padding: 0.02em 1em 0.02em 1em;
    font-size:medium;
    background-color: #ffffff;
}
.itemTile
{
    border-radius: 3px;
    margin: 3px -1em 3px -1em;
    padding: 0.02em 1em 0.02em 1em;
    font-size:medium;
    background-color: #ffffff;
}


/* IDs */

.container-avatar
{
    width: calc(32px * var(--pixel-size));
    height: calc(32px * var(--pixel-size));
    display: block;
    overflow: hidden;
    /*background: red;*/
    margin: auto;
    position: relative;
}

.animated-sprite
{
    animation: move-sprites 1s steps(4) infinite;
    width: calc(128px * var(--pixel-size));
    position: absolute;
}

.status-bar-player
{
    width: calc(2px * var(--pixel-size));
    float: right;
    display: block;
}
.status-bar-enemy
{
    width: calc(2px * var(--pixel-size));
    float: left;
    display: block;
}

/* Classes for stance animations */
.stance-fight
{
    top: calc(-32px * var(--pixel-size));
}
.anim-attack
{
    transform: translate3d(0px, 0, 0);
    top: calc(-64px * var(--pixel-size));
}
.anim-run
{
    transform: translate3d(0px, 0, 0);
    top: calc(-96px * var(--pixel-size));
}
.anim-chest
{
    transform: translate3d(0px, 0, 0);
    top: calc(-128px * var(--pixel-size));
}
.anim-look
{
    transform: translate3d(0px, 0, 0);
    top: calc(-160px * var(--pixel-size));
}

/* Animation: move keyframes left by 32px at a time, continuously */
@keyframes move-sprites
{
    from 
    {
        transform: translate3d(0px, 0, 0)
    }
    to
    {
        transform: translate3d(-100%, 0, 0)
    }
}

/* Media queries - mobile */
@media only screen and (hover: none) and (pointer: coarse)
{
    :root
    {
    --pixel-size: 3;
    }
    header
    {
        min-height: 50px;
        display: flex;
        background-color: rgba(255, 255, 255, 0.267);
        background-image: url("images/grass_patch.png");
        background-repeat: no-repeat;
        background-position: 50% 100%;
        background-size: calc(160px * var(--pixel-size));
        height: 15vh;
        padding: 1em;
    }
    main
    {
        font-family: '8bit', Times, serif;
        font-size: large;
        height: 30vh;
        padding: 1em 1em 1em 1.5em;
    }
    footer
    {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        background-color: rgb(255, 255, 255);
        height: 30vh;
        padding: 0em 1em 1em 1em;
    }
    input[type=button], input[type=submit], input[type=reset]
    {
        width: 100%;
        height: 3rem;
    }
    .title
    {
        transform: translateY(0.2em)
    }

}

@media only screen and (hover: none) and (pointer: coarse) and (orientation: landscape)
{
    :root
    {
    --pixel-size: 1.5;
    }
}