﻿* {
   -moz-box-sizing:    border-box;
   -webkit-box-sizing: border-box;
    box-sizing:        border-box;
}

html {
    background: #111111;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

body {
    background-color: #111111;
    margin: auto;
    max-width: 1920px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    overflow: hidden;
}

.noselect,
button {
    -webkit-touch-callout: none; /* iOS Safari */
      -webkit-user-select: none; /* Safari */
       -khtml-user-select: none; /* Konqueror HTML */
         -moz-user-select: none; /* Old versions of Firefox */
          -ms-user-select: none; /* Internet Explorer/Edge */
              user-select: none; /* Non-prefixed version, currently
                                    supported by Chrome, Edge, Opera and Firefox */
  }

#game_wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

#game_wrapper > * {
    flex:auto 0 0;
}

#game_wrapper > #game_container {
    flex:auto 1 1;
    height: unset;
    overflow: hidden;
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    margin: 0;
}

* {
    font-family: tahoma;
}

a {
    color: inherit;
}

footer{
    color:#6c6c6c;
    text-align: center;
    font-size: 0.75em;
    margin-bottom: 20px;
}

.mini {
    max-width: 0;
    display: inline-block;
}

img {
    max-width: 100%;
}

button {
    cursor: pointer;
}

#top_banner {
    line-height: 0;
    background-image: url("../images/top-banner.jpg");
    background-size: cover;
}

#top_banner img {
    width: 100%;
    animation: 15s linear 30s normal 1 both running fade-in;
}

span.version {
    position: absolute;
    top: 2px;
    right: 12px;
    font-size: 0.6em;
}

#game_container {
    height: 100%;
    padding: 20px;
    color: #00ff90;
    background-color: #404040;
    margin-top: 30px;
    max-height: 96vh;
    margin-bottom: 2vh;
    margin: 20px 40px;

    display: flex;
    flex-direction: row;
}

#game_container > * {
    flex:auto 0 0;
    width: 50%;
}


#game_gui {
    position: relative;
    display: flex;
    flex-direction: column;
}

#title {
    position: relative;
    margin:5px 0 10px;
}

#title,
#inventory {
    flex: auto 0 0;
}

#gui_buttons{
    flex: auto 1 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    align-content: baseline;
    overflow: scroll;
}

#game_gui button {
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms linear;
}

#game_gui button.show{
    pointer-events: all;
    opacity: 1;
}

#game_gui button.template{
    display: none !important;
}


/* GAME CONSOLE */
#game_console_wrapper{
    position: relative;
}

#game_console_wrapper * {
    font-family: monospace;
}
@media screen AND (min-width:768px){
    #game_console_wrapper * {
        font-size: 0.9rem;
    }
}

#game_console_warning {
    position: absolute;
    display: none;
    top: 0;
    left: 0;
    background: red;
    padding: 5px;
    width: 100%;
    width: calc(100% - 23px);
    margin: 10px;
}

#game_console_warning p {
    margin:0;
}

#game_console_wrapper.warning #game_console_warning {
    display: block;
    z-index: 2;
}

#game_console_wrapper.warning::after {
    content: "";
    background-color: transparent;
    background: linear-gradient(0deg, rgba(0,0,0,0) 0%, rgba(51,51,51,0.8) 50%, rgba(51,51,51,0.8) 100%);
    position: absolute;
    top: 2px;
    left: 2px;
    right: 6px;
    height: 100px;
    z-index: 1;
}

#game_console {
    position: relative;
    background-color: #333333;
    padding: 10px;
    border: 2px solid #666666;
    height: 100%;
    font-family: monospace;
}

#game_console_text p {
    margin-bottom: 0;
    margin-top: 5px;
    min-height: 1em;
}

#game_console_text p:last-of-type {
    content: "";
    margin-bottom: 10vh;
}

.thought-bubble {
    color:#b4ffcd;
    opacity: 0.6;
}

.hidden {
    display: none;
}

/* BUTTONS */
button {
    color: #53ff8b;
    background: #666666;
    padding: 5px 15px;
    border-color: #53ff8b;
    margin-right: 10px;
    margin-bottom: 10px;
    z-index: 1;
    min-width: 120px;
}

button.skip {
    display: none;
    opacity: 0.0!important;
    min-width: 120px;
    cursor: default;
}

button:last-of-type.skip {
    display: inline-block;
}

.is-building button {
    pointer-events: none!important;
    color: #888888!important;
    border-color: #888888!important;
}

button.is-building {
    background: linear-gradient(270deg, #666666 0%, #666666 49%, #53ff8b 51%, #53ff8b 100%);
    background-size: 200% 200%;
    animation: 5s linear 0s normal 1 both running button-work-progress;
}

.combat-raised .call-to-arms,
.combat-battle .call-to-arms {
    display: none;
}

.combat-idle .uncall-to-arms,
.combat-battle .uncall-to-arms {
    display: none;
}


/* INVENTORY  */
#inventory {
    display: flex;
    transform: translate(-10px, 0px);
}

.inventory-item {
    flex: auto 0 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 2px 5px;
    padding: 2px 4px;
    flex-wrap: wrap;
    flex: auto 0 1;
    min-width: 0;
    min-height: 0;
    /* overflow: hidden; */
    /* background-color: #666666; */
}

.inventory-item > * {
    flex: auto;
}

.inventory-item .timer {
    position: absolute;
    bottom: 0;
    margin: auto;
    background-color: #b94848;
    width: 0%;
    height: 2px;
    z-index: 1;
    animation: 10000ms linear 0s infinite running timer;
}

.inventory-item img {
    max-width: 42px;
}

.inventory-item .value {
    font-size: 0.8em;
    z-index: 2;
}

.inventory-item[data-amount="0"]{
    display: none;
}




/* SCROLLBAR */
.scrollable::-webkit-scrollbar-thumb {
    background-color: #00ff90;
}
.scrollable::-webkit-scrollbar-track {
    background-color: #404040;
}
.scrollable::-webkit-scrollbar-corner {
    background-color: #404040;
}
.scrollable::-webkit-scrollbar {
    width: 0.25rem;
    height: 0.25rem;
}
.scrollable {
    -ms-overflow-style: auto;
    scrollbar-color: #00ff90 #404040;
    scrollbar-width: thin;
    overflow-y: scroll;
    overflow-wrap: break-word;
}

.no-overflow {
    overflow: hidden;
}


.alpha #top_banner::after {
    content: "This is an alpha build. The game is not done yet.";
    display: block;
    position: absolute;
    max-width: 70vw;
    /* height: 100px; */
    background: #c914169c;
    color: white;
    font-family: monospace;
    z-index: 999;
    top: 0;
    left: 0;
    line-height: 1rem;
    padding: 10px 20px;
    transform: translate(20px, 15px) rotate(-3deg);
}

.alpha .version::after{
    content:" alpha";
}


@media screen AND (max-width: 767px){
    #game_container {
        position: relative;
        padding: 10px;
        margin: 10px;
        flex-direction: column-reverse;
    }

    #game_container > * {
        width: unset;
        height: 50%;
    }

    .inventory-item {
        margin: 0 2px 0;
    }

    #game_console_text p:last-of-type {
        margin-bottom: 4vh;
    }

    footer{
        margin-bottom: 10px;
    }
    
    .alpha #top_banner::after {
        font-size: 0.8em;
        line-height: 1em;
        max-width: 80vw;
        transform: translate(10px, 30px) rotate(-3deg);
    }

    /* .game-window {
        width: 100%;
    } */
}

@keyframes timer {
  from {width: 0%;}
  to {width: 100%;}
}

@keyframes fade-in {
  from {opacity: 0;}
  to {opacity: 1;}
}



@keyframes button-work-progress {
    0%{background-position:100% 50%}
    100%{background-position:0% 50%}
}



.inventory-item.scraps .animation {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url(../images/items-scraps.png);
    background-repeat: no-repeat;
    background-size: contain;
    animation: item-gather 0.2s linear 0s 1 normal both;
    transform: translate(20px, -25vh) scale(0.4, 0.1); 
    opacity: 0;
    z-index: 3;
}


@keyframes item-gather {
    0%{opacity:0;}
    30%{opacity:1;}
    90%{opacity:1;}
    100%{transform: translate(0px, 0vh) scale(1, 0.75); opacity:0;}
}