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;
  font-size:16px;
}

.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 {
  top: 10px;
  position: absolute;
  max-width: 100%;
  left:50%;
  transform:translateX(-50%);
  padding: 10px;
  text-align: center;
  background-color: rgba(0,0,0,0.4);
}

div.shop {
  touch-action: manipulation;
  position: absolute;
  top:0;
  right:0;
  padding:10px;
  height: calc(100% - 20px);
  background-color: rgba(10,60,10,1);
  box-shadow: inset 2px 2px 15px #131;
  width:20%;
  min-width: 310px;
  display: flex;
  flex-direction: column;
  color: #ddd;
  z-index: 100;
}
div.shop div.tabs button {
  margin-right: 5px;
  padding: 8px 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, div.level-select {
  position: absolute;
  top: 50%;
  left:50%;
  z-index: 150;
  transform:translate(-50%,-50%);
  padding:1rem;
  background-color: rgb(10,40,45);
  text-align: center;
  border-radius: 5px;
  box-shadow: inset 0 0 15px rgb(5,20,20);
  max-height: 90%;
}

div.start-game, div.end-level {
  overflow-y: auto;
}

div.end-level.confirm {
  z-index: 250;
}

div.end-level.confirm button {
  margin:1rem 1rem 0 1rem;
}

div.start-game h2, div.start-game h3, div.start-game h4 {
  margin:0.5rem 1rem;
}

div.start-game a {
  display: block;
  color:mediumseagreen;
  margin-bottom: 1rem;
  font-weight: bold;
  text-decoration: none;
} 
div.start-game a:hover {
  color:#8c8;
}

div.level-select.scroll { 
  overflow: auto;
}

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

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

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.shop > p {
  margin:8px 0 6px 0;
}

div.start-game button, 
div.end-level button,
div.level-select div.start button {
  padding: 8px 10px;
}
div.shop button {
  position: relative;
  font-size: 1em;
  padding: 8px 8px;
}
div.shop-title h2 {
  float:left;
  margin: 4px 0 8px;
  font-size: 1.2em;
}
div.shop-title button {
  float: right;
  padding: 6px 8px;
}

button.info {
  float: right;
  margin-left: 3px;
}

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;
  font-size: 1em;
}
div.shop div.upgrade h4 {
  float:left;
}
div.shop div.upgrade h4, div.shop div.bone-collectors h4 {
  font-size: 1em;
  line-height: 1em;
  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;
}

.text-center {
  text-align: center;
}

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

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

span.percent {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
}
label.sated > span.percent {
  left:50%;
  transform: translateX(-50%);
}
div.stats {
  white-space: nowrap;
  bottom:10px;
  left:50%;
  transform: translateX(-50%);
  position: absolute;
  background-color: rgba(0,0,0,0.5);
  padding:5px;
}
div.stats label {
  font-size:1em;
  text-shadow: 2px 2px #000;
  margin: 10px;
  white-space: nowrap;
}
div.stats button {
  margin:-5px 0;
  padding:0.25rem;
}

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

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

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

div.spells {
  position:absolute;
  bottom:-10px;
  left:0;
  transform: translateY(100%);
}

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

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: 1em;
  margin: 5px 5px 0 0;
  width:100%;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #ccc;
  cursor: pointer;
  text-shadow: 2px 2px #000;
}

div.buttons button.shatter {
  background: linear-gradient(270deg, rgba(0,0,0,0.5) 25%, dodgerblue 50%, rgba(0,0,0,0.5) 75%);
  background-size: 400% 400%;

  -webkit-animation: levelup-animation 4s ease infinite;
  -moz-animation: levelup-animation 4s ease infinite;
  animation: levelup-animation 4s ease infinite;
}

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;
}

.parts {
  color: #fb2;
}

.parts span.percent {
  background-color: #fb2;
}

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

div.generator-progress.active {
  height: 12px;
  margin: 8px 0;
}

div.generator-progress {
  height: 1px;
  margin: 2px;
  position: relative;
}
div.generator-progress.active > span.percent {
  height: 100%;
  border-radius: 15px;
  animation:width-animation 4s linear infinite reverse;
}

@media screen and (min-width: 1700px) {
  html,body {
    font-size: 18px;
  }
}

@media screen and (max-width: 900px) {
  html,body {
    font-size: 14px;
  }
  div.stats.zoom {
    bottom:10px;
    right:10px;
    transform: none;
    left: auto;
  }
}

@media screen and (max-width: 1800px) {
  div.shop div.tabs button {
    margin-right: 0;
  }
  div.start-game button, div.end-level button, div.shop button {
    padding: 6px 6px;
  }
  div.level-select {
    width:60%;
  }
}
@media screen and (max-width: 1509px) {
  div.buttons.open {
    right: 325px;
  }
  div.level-select {
    width:70%;
  }
}

@media screen and (max-width: 1040px) {
  div.start-game, div.end-level {
    width: 90%;
  }
  div.level-select {
    width:80%;
  }
  .inventory .item {
    width:3.5em !important;
    height:3.5em !important;
  }
}
@media screen and (max-width: 579px) {
  div.shop {
    width:80%;
  }
  div.buttons {
    top:auto;
    bottom: 40px;
  }
  div.buttons.open {
    right:0;
  }
  div.buttons button {
    padding: 5px 10px;
  }
  div.start-game button, div.end-level button, div.shop button {
    padding:10px;
  }
}

div.message {
  background-color: rgba(0,0,0,0.4);
  position: absolute;
  top:10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5em;
  padding:0 0.5rem;
  z-index: 150;
}

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

div.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%;}
}

#prestige-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  left:0;
  top:0;
}

.levelup {
  background: linear-gradient(270deg, rgba(0,0,0,0) 25%, #ffee10 50%, rgba(0,0,0,0) 75%);
  background-size: 400% 400%;

  -webkit-animation: levelup-animation 2s ease;
  -moz-animation: levelup-animation 2s ease;
  animation: levelup-animation 2s ease;
}

@keyframes levelup-animation {
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}

::-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%;
}

div.level-stats {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.5);
  text-align: left;
  text-shadow: 2px 2px #000;
  padding:5px 10px;
}

div.level-stats td {
  padding-right: 10px;
}

div.resources {
  position: absolute;
  left: 10px;
  top: 10px;
  background-color: rgba(0,0,0,0.5);
}

div.resources label {
  position: relative;
  display:block;
  font-size:1.2em;
  margin:10px;
  text-shadow: 2px 2px #000;
}

div.resources label > span.value {
  float:right;
  margin-left: 0.5em;
}

div.spells > div.skeleton {
  position: absolute;
  height:5em;
  width: 100%;
  left:0;
  top:100%;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  background-image: url("images/skeleton.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 5px;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

div.skeleton > .bg {
  position: absolute;
  width: 100%;
  height: 100%;
}
div.skeleton:hover {
  color: #ff3;
  box-shadow: 0 0 5px #ffee10;
  text-shadow: 0 0 5px #ffee10;
}

div.skeleton > div.xp {
  position: absolute;
  right: 0;
  background-color: #000;
  height:100%;
  width: 5px;
}
div.skeleton > div.xp > span {
  background-color: #fb2;
  position: absolute;
  bottom: 0;
  left: 1px;
  width: 3px;
}

div.skeleton > div.lvl {
  width: calc(100% - 5px);
  text-align: center;
  bottom: 0;
  position: absolute;
  background: rgba(0,0,0,0.8);
}

div.skeleton > div.lvl.dead {
  color:#fd5252;
}
.inventory {
  margin: 0.5em 0;
  height:400px;
  overflow: visible;
}
.inventory .equipped, .inventory .items {
  float:left;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.inventory .equipped {
  width: 40%;
}
.inventory .items {
  width:60%;
}

.inventory .item {
  width:4em;
  height:4em;
  border:1px solid white;
  margin: 0.5em;
  position: relative;
  display: inline-block;
}

.inventory .item .icon {
  position: absolute;
  height:100%;
  width: 100%;
  top:0;
  left:0;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.inventory .items .item, .inventory .equipped .item.trash {
  cursor: pointer;
}

.inventory .equipped .item.item.sword {
  clear: both;
}

.inventory .item.empty {
  background-color: #555;
}
.inventory .item.common {
  background-color: mediumseagreen;
}
.inventory .item.rare {
  background-color: dodgerblue;
}
.inventory .item.epic {
  background-color:#fb2;
}
.inventory .item.legendary {
  background: linear-gradient(270deg, #6b1610, #fc3503, #6b1610);
  background-size: 190% 200%;

  -webkit-animation: levelup-animation 4s linear infinite;
  -moz-animation: levelup-animation 4s linear infinite;
  animation: levelup-animation 4s linear infinite;
}
.inventory .item.helmet .icon {
  background: url("images/helmet.png");
}
.inventory .item.chest .icon {
  background: url("images/chest.png");
}
.inventory .item.legs .icon {
  background: url("images/legs.png");
}
.inventory .item.gloves .icon {
  background: url("images/gloves.png");
}
.inventory .item.boots .icon {
  background: url("images/boots.png");
}
.inventory .item.sword .icon {
  background: url("images/sword.png");
}
.inventory .item.shield .icon {
  background: url("images/shield.png");
}
.inventory .item.trash .icon {
  background: url("images/trash-can.png");
  background-position-y: -5px;
}
.inventory .item .icon {
  background-size: contain !important;
}
.inventory .equipped.helmet .item.helmet.over, .inventory .equipped.chest .item.chest.over, .inventory .equipped.legs .item.legs.over, .inventory .equipped.gloves .item.gloves.over,
.inventory .equipped.boots .item.boots.over, .inventory .equipped.sword .item.sword.over, .inventory .equipped.shield .item.shield.over, .inventory .equipped .item.trash.over {
  color: #ff3;
  box-shadow: 0 0 16px #ffee10;
}
.inventory .equipped.helmet .item:not(.helmet):not(.trash), .inventory .equipped.chest .item:not(.chest):not(.trash), .inventory .equipped.legs .item:not(.legs):not(.trash), .inventory .equipped.gloves .item:not(.gloves):not(.trash),
.inventory .equipped.boots .item:not(.boots):not(.trash), .inventory .equipped.sword .item:not(.sword):not(.trash), .inventory .equipped.shield .item:not(.shield):not(.trash)  {
  opacity: 0.2;
}

.inventory .item .level {
  float:right;
  color:#333;
  position: relative;
  font-weight: bold;
  margin-right: 0.2em;
  font-size: 1em;
}
.inventory .item .tooltip {
  position: fixed;
  display: none;
  background-color: rgb(12,55,55);
  box-shadow:rgb(0, 0, 0) 5px 5px 15px;
  border-radius: 5px;
  width: 250px;
  padding:0.5em;
  z-index: 150;
}
#champ-hold.overflow {
  overflow-y: auto;
}
#champ-hold:not(.no-tooltip) .inventory .item:hover .tooltip {
  display: inline-block;
}
#champ-hold p {
  margin:0.5em 0;
  color: #ddd;
}
#champ-hold h2 > button {
  margin: -0.5rem 0 -0.5rem 0.5rem;
  float: none;
  font-size: 1rem;
}
#champ-hold .talents h4 {
  margin: 0.5rem 0;
}
#champ-hold .talents h4 > button {
  padding:0.5rem;
  margin-left: 0.5rem;
}
#champ-hold .talents .talent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
}
#champ-hold .talents .talent-grid .talent {
  box-shadow: inset 2px 2px 8px rgb(5 20 20);
  padding:0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 5px;
}
#champ-hold .talents .talent-grid .talent button {
  padding:0.25rem 0.5rem;
}
#champ-hold .talents .talent-grid .talent.inactive p {
  color:#666;
}
#champ-hold .talents .talent-grid .talent.full {
  background-color: rgb(20,50,55);
}
#champ-hold .talents .talent-grid .talent p:not(.info) {
  display: inline;
  font-weight: bold;
}
.inventory .item .tooltip span.name {
  font-weight: bold;
  display: block;
  margin-bottom: 0.3em;
}
.inventory .item .tooltip span.desc, .inventory .item .tooltip span.stat, .inventory .item .tooltip span.effect {
  display:block;
  line-height: 1.5em;
}
.inventory .item .tooltip span.stat {
  color:#3aca51;
}
.inventory .item .tooltip span.xp {
  font-size: 0.8em;
}
.inventory .item .tooltip span.effect {
  font-style: italic;
  color: #ffee10;
}

div.level-select > div.levels > button {
  display:block;
  float:left;
  width:calc(10% - 4px);
  border:1px solid #aaa;
  padding:5px 0;
  text-align: center;
  margin:2px;
  cursor: pointer;
  position: relative;
}

div.level-select > div.levels > button.boss {
  color:#fd5252;
  font-weight: bold;
}

div.level-select > div.levels > button.completed {
  color:mediumseagreen;
}

div.level-select > div.levels > button.active {
  background: #000;
  color: #ff3;
}

div.level-select > div.levels > button.completed:after {
  content:"\2714";
  position: absolute;
  top: 2%;
  right: 25%;
  transform: translateX(100%);
}

div.level-select > div.levels > button.boss:not(.completed):after {
  content:"\1F451";
  position: absolute;
  top: 0;
  right: 25%;
  transform: translateX(90%);
  font-size: 0.8em;
}

div.level-select > div.levels > button.trophy:not(.boss):after {
  content:"\1F3C6";
  position: absolute;
  top: 10%;
  right: 25%;
  transform: translateX(90%);
  font-size: 0.8em;
}

div.level-select div.ranges button {
  padding: 8px 10px;
  margin: 5px;
}

div.level-select div.start label {
  display:block;
  margin-bottom:1em;
}

div.level-select div.start, div.level-select div.ranges {
  padding: 0.5em;
}

div.level-select > label {
  font-size: 1.2em;
}

.mt-5 {
  margin-top:5px;
}