* {
  font-family: 'Zilla Slab', sans-serif;
  box-sizing: border-box;
  
  user-select: none;
}

html {
  font-size: 12px;
}

html, body, canvas {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

canvas {
  image-rendering: pixelated;
  filter: saturate(1.0) contrast(1.0);
  transition: filter 0.2s;
}

h1 {
  font-size: 4rem;
  font-family: 'Zilla Slab', sans-serif;
  text-align: center;
  margin: 1rem 0 3.5rem 0;
  user-select: none;
}

h2 {
  font-size: 2.5em;
  font-family: 'Zilla Slab', sans-serif;
  text-align: center;
  margin: 0 0 2rem 0;
  user-select: none;
}

h3 {
  font-size: 2.5em;
  font-family: 'Zilla Slab', sans-serif;
  text-align: center;
  margin: 0 0 0.8em 0;
  user-select: none;
}

.hidden {
  display: none !important;
}

.h-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.v-flex {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-around;
  width: 100%;
}

.spacer {
  flex: 1 1 1em;
}

.hoverable:hover {
  filter: invert(1);
}

div.hoverable:hover > img {
  filter: invert(1);
}

.disabled {
  opacity: 0.3;
}

.h3-button {
  padding: 2rem 3rem 0;
  display: block;
}

/* Ded */
#ded {
  position: absolute;
  height: 0px;
  top: 50vh;
  left: calc(50vw - 10rem);
  width: 20rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#ded > button {
  margin-bottom: 1rem;
  width: 30rem;
}

#pepsi {
  box-shadow: 0 0 10px 10px #00000099;
  background: #00000099;
  width: 100vw;
  font-size: 10rem;
  font-family: 'Cinzel', serif;
  color: #a12323;
  text-align: center;
  margin-bottom: 2rem;
}

/* Log messages */
#messages {
  position: absolute;
  right: 0;
  bottom: 0;
  align-items: end;
  justify-content: end;
  padding: 0 2em 2em 0;
}

#messages span {
  font-family: "JetBrains Mono", monospace;
}

.log-message {
  opacity: 1;
  transition: opacity 0.5s;
  font-style: italic;
  font-size: 1rem;
}

/* HUD Display */
#hud {
  pointer-events: none;
  position: absolute;
  box-sizing: border-box;
  padding: 24px 0 0 16px;
}

#avatar {
  pointer-events: none;
  height: 10rem;
  flex: 0 0 10rem;
  outline: 2px solid white;
  border-radius: 5rem;
  background-color: #00000066;
  overflow: clip;
  text-align: center;

  margin-right: 1rem;

  user-select: none;
  position: relative;
}

#avatar > span {
  line-height: 10rem;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  color: white;
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

#xp-bar {
  position: absolute;
  height: 12rem;
  width: 12rem;
  background-color: rgba(141, 243, 233, 0.589);
  z-index: 0;
  top: 100%;
  transition: top 0.5s ease-out;
}

#hpbar-outer {
  width: 46.2rem;
  height: 1rem;
  outline: 2px solid white;
  border-radius: 5px;
  background-color: #66444477;
  
  margin-bottom: 1rem;
}

#hpbar-inner {
  background-color: red;
  height: 100%;
  width: 39%;
}

#gun-control-tooltip {
  position: absolute;
  width: unset;
  left: 18em;
  top: 9em;
  align-items: start;

  opacity: 0.8;
}

#gun-control-tooltip svg {
  margin-right: 4px;
}

.key-tag {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: black;
  background: white;
  padding: 2px 6px;
  border: 2px solid white;
  border-radius: 4px;
}

#guns-container {
  width: 46.2rem;
  font-size: 0.8rem;
  align-items: start;
  justify-content: start;
}

.gun-slot {
  flex: 0 0 17em;
  width: 17em;
  min-height: 8em;

  outline: 2px solid white;
  border-radius: 5px;
  background-color: #00000066;

  margin-right: 1rem;
  height: 1px;
}

.gun-slot:first-child {
  font-size: 1rem;
}

.gun-img {
  margin: 0 0.66em;
  image-rendering: pixelated;
  width: 2.66em;
  height: 2.66em;
}

.gun-info {
  height: 100%;
  border-left: 2px solid white;
}

.gun-stats {
  flex: 1;
  padding: 0.66em 0 0.66em 0.66em;
  border-top: 2px solid white;
  width: 100%;
}

.gun-stat {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-style: italic;
  color: white;
}

.stat-img {
  filter: invert(1);
  margin-top: 0.33em;
  margin-bottom: -0.33em;
  width: 1.33em;
  height: 1.33em;
}

.stat-img-col2 {
  margin-left: 3.75em;
  margin-right: -5em;
}

h5.gun-stat {
  margin: 0.66em 0 0.66em 0.66em;
  font-weight: 600;
  font-size: 1em;
}

#turrets-container {
  margin-top: 3rem;
}

.turret-slot {
  flex: 0 0 1em;
  width: 18em;
  min-width: 18em;
  min-height: 12em;
  height: 1px;

  outline: 2px solid white;
  border-radius: 5px;
  background-color: #00000066;

  margin: 0 1rem 1rem 0;
  position: relative;
}

.turret-slot > .key-tag {
  position: absolute;
  left: 0;
  top: 0;
  border: 0px;
  border-bottom: 2px solid white;
  border-right: 2px solid white;
  border-radius: 0 0 4px 0;
}

.turret-img {
  margin: 0 1.17em 2em;
  width: 2.66em;
  height: 2.66em;
  image-rendering: pixelated;
}

.turret-base-img {
  margin: 0.66em -4em 0 1.33em;
  width: 2.66em;
  height: 5.33em;
  image-rendering: pixelated;
}

.turret-deployment-status {
  margin: 0 0.66em 0.66em 0.66em;
}

.turret-hpbar-outer {
  flex: 0 0 0.5em;
  width: 11em;  
  margin: 0 0 0.66em 0.66em;
  background-color: #FFAAAACC;
}

.turret-hpbar-inner {
  background-color: red;
  height: 100%;
  width: 39%; 
}

.chest-option {
  width: 18em;
  padding: 2em 0;
  margin: 0 0.5em;
}

/* DIALOGS */

button {
  pointer-events: all;
  cursor: pointer;
}

dialog {
  position: relative;
  display: block;
  top: 50%;
  transform: translateY(-50%);
  padding: 24px 48px;
  background: #91a978;
  border: 4px solid #778b60;
  border-radius: 8px;
}

.modal-backdrop {
  width: 200vw;
  height: 200vh;
  position: fixed;
  top: -50vh;
  left: -50vw;
  background-color: #00000066;
}

#the-new-gun {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  padding-left: 10px;
}

#replace-gun-slots {
  margin-bottom: 2rem;
  padding-left: 10px;
}

.dialog-slots-container {
  padding-left: 1rem;
}

.dialog-slots-container > .gun-slot, .dialog-slots-container > .turret-slot {
  align-self: stretch;
}

.dialog-slots-container > .selected {
  outline-width: 7px;
  outline-offset: -2px;
  outline-color: gold;
}

.dialog-slots-container > .selected:hover {
  outline-color: rgb(0, 40, 255);
}

.gun-slots {
  margin-bottom: 2em;
}

#the-new-gun > .gun-slot, .dialog-slots-container > .gun-slot {
  min-height: 16em;
}

.dialog-slots-container > .turret-slot {
  min-height: 20em;
}

#upgrade-done-slots {
  margin-bottom: 4em;
}

#upgrade-done-slots h1 {
  display: inline;
  margin: 0 20px 0 10px;
}

#upgrade-done-slots > .gun-slot {
  min-height: 16em;
}

#upgrade-done-slots > .turret-slot {
  min-height: 20em;
}

#pause-game > button {
  width: 100%;
  margin-bottom: 1em;
}

#options {
  overflow-y: scroll;
}

#controls-diagram {
  font-size: 0.8rem;
  flex-wrap: wrap;
  max-height: calc( 405px + 10em );
  height: calc( 405px + 10em );
  align-items: center;
}

.hybridize-select-subdialog {
  position: absolute;
  background: #91a978;
  border: 4px solid #778b60;
  border-radius: 8px;
  padding: 1rem 0;
  box-shadow: 9px 12px 8px 2px #0000005e;
}

.hybridize-select-subdialog:after
{
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 20px 20px;
    border-color: #91a978 transparent;
    display: block;
    width: 0;
    z-index: 1;
    margin-left: -20px;
    top: -20px;
    left: 50%;
}

.hybridize-select-subdialog:before
{
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 23px 23px;
    border-color: #778b60 transparent;
    display: block;
    width: 0;
    z-index: 0;
    margin-left: -23px;
    top: -27px;
    left: 50%;
}

#the-new-turret.dialog-slots-container > .gun-slot, #the-new-turret.dialog-slots-container > .turret-slot {
  align-self: unset !important;
}

@keyframes throb {
  from {opacity: 0.8;}
  to {opacity: 0.4;}
}