html,body {
  font-family: sans-serif;
  height: 100%;
  width: 100%;
  margin: 0;
  color:#fff;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: contain;
}

.clear {clear:both;}

canvas {
  height: 100%;
  width: 100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

div.top-bar {
  position: absolute;
  max-width: 100%;
  top:0;
  left:50%;
  transform:translateX(-50%);
  padding: 10px;
  text-align: center;
  background-color: rgba(0,0,0,0.4);
}

div.top-bar div.message {
  position: absolute;
  left: 50%;
  transform: translate(-50%,100%);
  bottom: -15px;
  background-color: rgba(0,0,0,0.4);
  font-size: 20px;
  line-height: 24px;
  width: 75%;
}

div.top-bar div.resources {
  white-space: nowrap;
}

div.shop {
  touch-action: manipulation;
  position: absolute;
  top:0;
  right:0;
  padding:10px;
  height: calc(100% - 20px);
  background-color: rgba(10,60,10,0.8);
  width:20%;
  min-width: 310px;
  display: flex;
  flex-direction: column;
  color: #ddd;
  z-index: 100;
}
div.shop div.tabs button {
  margin-right: 5px;
}
button.active {
  box-shadow: inset 0 0 5px #ffee10;
  text-shadow: 0 0 1px #ffee10;
}

div.shop div.upgrades {
  overflow-y: auto;
  flex:1;
  margin-top:5px;
  overscroll-behavior: contain;
}

div.shop div.upgrade.uncollected {
  opacity: 0.5;
}
div.shop div.upgrade.owned {
  color:#ffee10;
}
div.shop div.upgrade span.escaped {
  color:#f33;
  float: right;
}

div.shop div.upgrade div.progress {
  text-align: center;
  margin: 10px 0;
  background: #000;
  position: relative;
}
div.shop div.upgrade div.progress.active {
  box-shadow: inset 0 0 5px #ffee10;
}
div.shop div.upgrade div.progress > span {
  z-index: 100;
  position: relative;
}

div.shop div.upgrade div.progress > div {
  position: absolute;
  height: 100%;
  background: #a1980f;
  top:0;
  z-index: 50;
}

div.start-game, div.end-level {
  position: absolute;
  top: 50%;
  left:50%;
  transform:translate(-50%,-50%);
  padding:15px;
  background-color: rgba(10,60,10,0.9);
  text-align: center;
}

div.start-game ul > li {
  text-align: left;
  line-height: 26px;
}

button {
  background: rgba(0,0,0,0.4);
  border: none;
  color: #ccc;
  cursor: pointer;
  text-shadow: 2px 2px #000;
  font-size: 20px;
}

a.button {
  text-decoration: none;
}

button:hover:not(:disabled) {
  background: rgba(0,0,0,0.8);
  color: #ff3;
  box-shadow: 0 0 5px #ffee10;
  text-shadow: 0 0 5px #ffee10;
}
button:hover:disabled {
  /* color: #f33; */
  box-shadow: inset 0 0 5px #f33;
}
button:disabled {
  color:#666;
}
button:focus {outline:0;}

div.start-game button, 
div.end-level button,
div.shop button {
  padding: 8px 10px;
  font-size: 18px;
}
div.shop div.shop-title h2 {
  float:left;
  margin: 8px 0;
}
div.shop div.shop-title button {
  float: right;
}

button.info {
  float: right;
}

div.shop div.upgrade, div.shop div.bone-collectors {
  background-color: rgba(20,30,20,0.8);
  padding:10px;
  margin-bottom:10px;
  position: relative;
}

div.shop h4 > button {
  float:right;
  margin: -5px 0 5px 0 !important;
}

div.shop div.bone-collectors button {
  margin: 5px 0 0 0;
  padding : 8px 15px;
}
div.shop div.bone-collectors .cages button {
  padding : 8px 8px;
}
div.shop div.bone-collectors label {
  margin:10px;
}
div.shop h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
}
div.shop div.upgrade h4 {
  float:left;
}
div.shop div.upgrade h4, div.shop div.bone-collectors h4 {
  font-size: 18px;
  line-height: 18px;
  margin: 0 0 5px 0;
  clear: both;
}

div.shop div.upgrade:not(.current-construction) p, div.shop div.bone-collectors p{
  margin:5px 0;
  font-style: italic;
  line-height: 20px;
  clear:both;
}
div.shop div.upgrade.current-construction {
  margin-top:5px;
}

div.shop div.upgrade p {
  clear:both;
}
div.shop div.upgrade label {
  display: block;
}

div.shop div.upgrade label, div.shop div.bone-collectors label {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 5px;
  clear:both;
}

div.shop div.upgrade h4.cost {
  float: right;
  clear: none;
  margin-bottom: 0;
}

div.top-bar label {
  position: relative;
  font-size:24px;
  margin: 15px;
  white-space: nowrap;
  text-shadow: 2px 2px #000;
}
span.percent {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
}
div.top-bar div.stats {
  padding-top:10px;
}
div.top-bar div.stats label {
  font-size:20px;
}

div.zoom-buttons {
  position: absolute;
  bottom:0;
  left:0;
  padding:10px;
}

div.zoom-buttons button {
  padding:10px 15px;
  font-size:20px;
}

div.buttons {
  position: absolute;
  top:90px;
  right:0;
  padding:10px;
}

div.spells {
  position:absolute;
  top:95px;
  left:0;
  padding:10px;
}

div.spells > button.spell {
  padding:8px 10px;
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 5px;
  font-size: 18px;
}

div.spells > button.spell.active {
  color:#fff;
}

div.spells > button.spell.cooldown {
  color:#555;
}
div.spells > button.spell span.tooltip {
  display: none;
  position: absolute;
  top: 50%;
  right: -10px;
  transform: translate(100%,-50%);
  width: 200%;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  z-index: 10;
}

div.spells > button.spell span.timer {
  position: absolute;
  top: 0;
  right: -5px;
  transform: translateX(100%);
  width: 35px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.4);
  z-index: 5;
}

div.spells > button.spell:hover span.tooltip {
  display: block;
}

div.buttons.open {
  right:calc(20% + 15px);
}

div.buttons button {
  position: relative;
  display:block;
  padding: 8px 10px;
  font-size: 18px;
  margin: 5px 5px 0 0;
  width:100%;
  background: rgba(0,0,0,0.4);
  border: none;
  color: #ccc;
  cursor: pointer;
  text-shadow: 2px 2px #000;
}

div.buttons button:not(.cooldown):hover, div.buttons button.active {
  background: rgba(0,0,0,0.8);
  color: #ff3;
}

div.buttons button span.tag {
  left: -4px;
  position: absolute;
  transform: translateX(-100%);
}

p.prestige-info {
  margin:5px 0;
}

.energy {
  color: dodgerblue;
}

.energy span.percent {
  background-color: dodgerblue;
}

.blood {
  color: #fd5252;
}

.blood span.percent {
  background-color: #fd5252;
}

.brains {
  color: mediumseagreen;
}

.brains span.percent {
  background-color: mediumseagreen;
}

.bones {
  color: #ccc;
}

.bones span.percent {
  background-color: #ccc;
}

ul {
  padding-inline-start: 20px;
  clear:both;
}

@media screen and (max-width: 1800px) {
  div.shop div.tabs button {
    margin-right: 0;
    font-size: 16px;
  }
  div.top-bar label {
    font-size:20px;
  }

  div.top-bar div.stats label {
    font-size:18px;
  }
  div.start-game button, div.end-level button, div.shop button {
    padding: 8px 10px;
    font-size: 16px;
  }
}
@media screen and (max-width: 1530px) and (min-width: 820px) {
  div.top-bar.open {
    left: 0;
    transform: none;
    width: calc(100% - 340px);
  }

  div.top-bar.open div.resources {
    white-space: normal;
  }
}
@media screen and (max-width: 1509px) {
  div.buttons.open {
    right: 325px;
  }
}

@media screen and (max-width: 1040px) {
  div.top-bar {
    width:100%;
  }
  div.top-bar div.resources {
    white-space: normal;
  }
  div.start-game, div.end-level {
    width: 90%;
  }
}

@media screen and (max-width: 579px) {
  div.top-bar label {
    margin:5px;
    font-size:16px;
  }
  div.top-bar div.resources label {
    width:40%;
    display: inline-block;
    margin: 5px 0;
  }
  div.top-bar div.stats label {
    font-size : 16px;
  }
  div.top-bar div.stats {
    padding-top:5px;
    clear:both;
  }
  div.shop {
    width:80%;
  }
  div.buttons {
    top:auto;
    bottom:0;
  }
  div.buttons.open {
    right:0;
  }
  div.buttons button {
    padding: 5px 10px;
  }

  div.top-bar div.message {
    font-size: 18px;
    line-height: 24px;
    padding: 0 20px;
    width:80%;
  }
  div.start-game button, div.end-level button, div.shop button {
    padding:10px;
  }
}

.message > p {
  position: relative;
  text-shadow: 2px 2px #000;
}

.message > p::after {
  content:"";
  height:2px;
  background-color: #fff;
  position: absolute;
  animation:width-animation 4s linear;
  bottom:0;
  left:50%;
  transform: translateX(-50%);
}

@keyframes width-animation {
  0% {width:100%;}
  100% {width:0%;}
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #555;
}

::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

div.upgrade .row {
  clear: both;
  display: table;
  width:100%;
  margin:5px 0;
}
div.upgrade .col {
  float:left;
  width: 65%;
}
div.upgrade .col button {
  width:100%;
}
div.upgrade .col:nth-of-type(2) {
  width: 35%;
}