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, 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;
    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%;
    transform: translate(-50%, -50%);
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    text-align: center;
}

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: 1.2em;
}

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;
    font-size: 1.2em;
}

div.shop button {
    position: relative;
    font-size: 1em;
    padding: 8px 8px;
}

div.shop div.shop-title h2 {
    float: left;
    margin: 4px 0 8px;
    font-size: 1.2em;
}

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

div.shop div.upgrade label,
div.shop div.bone-collectors label {
    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;
}

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

@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 15px;
}

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

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

::-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: 55px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    text-align: left;
    text-shadow: 2px 2px #000;
    padding: 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.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.trophy:after {
    content: "?";
    position: absolute;
    top: 2%;
    right: 20%;
    transform: translateX(100%);
}

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: 1em;
}

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

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