#dungeon, #dungeon canvas {
  display:flex;
  background-color: #000;
  width: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  align-self:center;
}
#leave-dungeon {
  display: flex;
  flex: 1;
  align-items: flex-end;
}
#dungeon-leave {
  flex: 1;
}
main.in-dungeon form {
  display: none;
}
#service-worker-update {
  position:absolute;
  right:0;
  bottom:top;
  height:40px;
  width:40px;
  display:flex;
  align-items:center;
  justify-content: center;
  padding:0;
}
#service-worker-update:after {
  content:" ";
  display:block;
  width: 40px;
  height: 40px;
  border: 3px solid #CBA82C;
  border-radius: 8px;
  position:absolute;
  top:-5px;
  left:-5px;
  animation: pulse 2s ease 0s infinite;
}
#under-dungeon {
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: flex-end;
  flex: 1;
  padding: 8px;
}
.mask {
  position:fixed;
  top:0;
  left:0;
  height:100%;
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background-color:rgba(0,0,0,0.9);
  z-index: 9001;
}

.controls {
  display:grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto;
  grid-gap: 4px;
  font-size:0;
}
#spells, #skills {
  grid-template-columns: auto auto;
  grid-template-rows: auto;
}
.space-around {
  justify-content: space-around;
}
#dungeonMessage {
  position:absolute;
  bottom:0;
  opacity:0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index:4;
  background-color:rgba(0,0,0,0.5);
  text-shadow: #000 0 0 3px, #000 0 0 3px, #000 0 0 3px, #000 0 0 3px, #000 0 0 3px;
}
#dungeonMessage[active] {
  opacity: 1;
  transform:translateY(100%);
}
.controls .button-style{
  height: 60px;
  width: 60px;
  border-radius: 8px;
  background-color: rgb(80,80,80);
  border: 1px solid rgb(120,120,120);
  color:white;
  fill:white;
  cursor: pointer;
  padding:0;
  margin:0;
  opacity: 0.8;
}
.controls button.button-style[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}
#run-state {
  flex-grow: 0;
  position: relative;
}
.direction {
  display:flex;
  align-items:center;
  justify-content: center;
}
#north {
  transform: rotate(-90deg);
}
#west {
  transform: rotate(180deg);
}
#south {
  transform: rotate(90deg);
}
.direction[iso] svg {
  transform-origin: center;
  transform: rotate(45deg);
}
main.in-dungeon #game {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: flex-start;
}
#dungeon.bad-direction {
  animation: shake 0.42s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}
#loot {
  color:white;
  display:flex;
  flex-direction:row;
  justify-content:space-between;
  align-items:center;
  padding: 8px 16px;
}
#pop-up {
  display:block;
  position: absolute;
  z-index: 10;
  top: 100%;
  min-width: 200px;
  width: 56.67vh;
  max-width: 100%;
  background-color: #000;
  transition: transform 0.4s cubic-bezier(0, 0, 0.6, 1);
  color:white;
  border-top: #999 1px solid;
  padding-bottom:44px;

}
#pop-up[active] {
  transform:translateY(-100%);
}
#screen, #sub-screen {
  font-family:'VT323', monospace;
}
#sub-screen {
  max-height: 85vh;
  display:flex;
  flex-direction:column;
  overflow:auto;
}
#shop-items {
  overflow:auto;
}
.notification {
  display:flex;
  align-items:center;
  justify-content: center;
  position:absolute;
  font-size: 16px;
  top:-12px;
  right:-12px;
  background-color:#E00;
  color:white;
  border-radius:8px;
  text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black;
  height:24px;
  width:24px;
}
[keyword] {
  color:gold;
}
[enemy-name] {
  color:#F00;
}
[enemy-roll] {
  color: #f74;
}
[player-roll] {
  color: #44F;
}
[player-hp] {
  color: #4FF;
}
[armor-damage] {
  color: #0A0;
}
[hp-damage] {
  color: #A00;
}
[player-damage] {
  color: #0F0;
}
[enemy-damage] {
  color: #F0F;
}

@keyframes pulse {
  0% {
      opacity: 1;
      transform: scale(1);
  }
  80% {
      opacity: 0;
      transform: scale(2);
  }
  100% {
      opacity: 0;
      transform: scale(3);
  }
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}
.progress {
  height: 20px;
  border-radius: 4px;
  background-color:#444;
  overflow:hidden;
  position:relative;
}
.progress-text {
  padding: 0 8px;
  display: flex;
  align-items: center;
  position:absolute;
  z-index:2;
  text-shadow: #000 0 0 3px, #000 0 0 3px, #000 0 0 3px, #000 0 0 3px, #000 0 0 3px
}
.progress-bar {
  background-color:#A00;
  height:100%;
  transition:transform 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
  transform-origin: left;
}
[owned]::before {
  content: "OWNED";
  color: #A00;
  display:flex;
  align-items: center;
  justify-content:center;
  height: 100%;
  width: 100%;
  position:absolute;
  top:0;
  left:0;
  border: 1px solid #A00;
  transform: rotate(-2deg);
  font-size: 40px;
  background-color: rgba(0,0,0,0.9);
}
#toggle-iso {
  position:absolute;
  bottom: -40px;
  right:0;
  height: 40px;
  width: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity: 0.6;
  fill: white;
  background:none;
  border:none;
}
@media screen and ( max-height: 600px) {
  .dialog {
    display:none;
  }
  #shop-controls p {
    font-size: 14px;
  }
  p {
    font-size: 16px;
  }
  #screen {
    width: 100%;
  }
}