* {
  box-sizing:border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: linear-gradient(180deg, #64BEFF -50%, #6e96ff 69.71%, #2a65ff 150%);
  /* background: darkkhaki; */
  font-family: 'Source Sans Pro', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.game-container { 
  position: relative;
  width: 240px;
  height: 208px;
  background: url('/images/map.png') no-repeat no-repeat;
  transform: scale(3);
  image-rendering: pixelated;
  /* z-index: 10; */
}

.player-info {
  position: absolute;
  top: 0;
  left:0;
  padding: 1em;
  display: flex;
  gap: 0.5em;
  align-items: flex-end;
  flex-wrap: wrap;

}

.market-info {
  position: absolute;
  top: 150px;
  left:0;
  padding: 1em;
  display: flex;
  gap: 0.5em;
  align-items: flex-end;
  flex-direction: column;

}


label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

input[type="text"],
button {
  font-family: inherit;
  font-weight: bold;
  font-size: 18px;
  height: 44px;
  border-radius: 4px;
  outline: 0;
}

input[type="text"] {
  outline: 0;
  padding-left: 0.5em;
  border: 3px solid #222034;
  width: 150px;
  text-transform: uppercase;
}
input[type="text"]:focus {
  border-color: #f000ff;
}

button {
  padding-left: 0.5em;
  padding-right: 0.5em;
  background: #59ff5a;
  border: 0;
  border-bottom: 2px solid #1e830b;
  cursor: pointer;
}
button:active {
  position: relative;
  top: 1px;
}

#toggle-device {
  background: #fcff59;
}

#toggle-device.clicked {
  background-color:  #59fcff;
}

#toggle-music {
  background: #ffc259;
}

#toggle-music.clicked {
    background-color:  #e959ff;
}

/* Characters */
.grid-cell {
  position: absolute;
  width: 16px;
  height: 16px;
}
.Character {
  transition: transform 0.4s;
  z-index: 1;
}
.Character.you {
  z-index: 2;
}
.Character.you .Character_you-arrow {
  display: block;
}
.Character_you-arrow {
  display: none;
  position: absolute;
  top:-19px;
  left: 5px;
  width: 7px;
  height: 5px;
  background: url(/images/arrow.png) no-repeat no-repeat;
}
.Character_sprite {
  overflow: hidden;
  top: -3px;
  background: url(/images/characters.png);
}
.Character[data-direction="right"] .Character_sprite {
  background-position-x: 80px;
}
.Character[data-color="red"] .Character_sprite {
  background-position-y: -16px;
}
.Character[data-color="orange"] .Character_sprite {
  background-position-y: -32px;
}
.Character[data-color="yellow"] .Character_sprite {
  background-position-y: -48px;
}
.Character[data-color="green"] .Character_sprite {
  background-position-y: -64px;
}
.Character[data-color="purple"] .Character_sprite {
  background-position-y: -80px;
}
.Character_shadow {
  background: url(/images/shadow.png) no-repeat no-repeat;
}

.Character_name-container {
  position: absolute;
  top: -13px;
  left: -12px;
  font-size: 5px;
  padding: 1px 2px 1px;
  border-radius: 3px;
  background: #333;
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
}
.Character_coins {
  margin-left: 1px;
  color: gold;
}
.Character_health {
  margin-right: 1px;
  color: greenyellow;
}

/* Coins */
.Coin_sprite {
  background: url(/images/coin.png) no-repeat no-repeat;
  animation: coinFloat 0.8s linear infinite alternate-reverse;
}
@keyframes coinFloat {
  from { transform: translateY(0) }
  to { transform: translateY(5px) }
}
.Coin_shadow {
  background: url(/images/coin-shadow.png) no-repeat no-repeat;
}

/* Projectile */
.Projectile {
  /* transition: transform 0.4s; */
}

.Projectile_sprite {
  overflow: hidden;
  top: -3px;
  background: url(/images/characters.png);
  /* animation: coinFloat 0.8s linear infinite alternate-reverse; */
}
@keyframes projectileAnimateLeft {
  0% { transform: translateX(32px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  50% { transform: translateX(0px); animation-timing-function: cubic-bezier(0.1, 0.7, 0.9, 0.3); }
  100% { transform: translateX(0px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
}
.Projectile[data-direction="left"] .Projectile_sprite {
  background-position-x: 48px;
  animation: projectileAnimateLeft 1s ease-in-out;
}
@keyframes projectileAnimateRight {
  0% { transform: translateX(-32px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  50% { transform: translateX(0px); animation-timing-function: cubic-bezier(0.1, 0.7, 0.9, 0.3); }
  100% { transform: translateX(0px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
}
.Projectile[data-direction="right"] .Projectile_sprite {
  background-position-x: 16px;
  animation: projectileAnimateRight 1s ease-in-out;
}

/* down */
@keyframes projectileAnimateUp {
  0% { transform: translateY(-32px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  50% { transform: translateY(0px); animation-timing-function: cubic-bezier(0.1, 0.7, 0.9, 0.3); }
  100% { transform: translateY(0px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
}
.Projectile[data-direction="up"] .Projectile_sprite {
  background-position-x: 32px;
  animation: projectileAnimateUp 1s ease-in-out;
}

/* up */
@keyframes projectileAnimateDown {
  0% { transform: translateY(32px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  50% { transform: translateY(0px); animation-timing-function: cubic-bezier(0.1, 0.7, 0.9, 0.3); }
  100% { transform: translateY(0px); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
}
.Projectile[data-direction="down"] .Projectile_sprite {
  background-position-x: 64px;
  animation: projectileAnimateDown 1s ease-in-out;

}


.Projectile[data-color="red"] .Projectile_sprite {
  background-position-y: -16px;
}
.Projectile[data-color="orange"] .Projectile_sprite {
  background-position-y: -32px;
}
.Projectile[data-color="yellow"] .Projectile_sprite {
  background-position-y: -48px;
}
.Projectile[data-color="green"] .Projectile_sprite {
  background-position-y: -64px;
}
.Projectile[data-color="purple"] .Projectile_sprite {
  background-position-y: -80px;
}

/* Joy Stick */
.move-buttons {
  display: none;
  flex-direction: column;
  align-items: center;
  transform: scale(1.7);
  margin-top: 300px;

  /* margin-bottom: 100px; */

  position: absolute;
  /* width: 100px; */
}

.move-buttons button {
  width: 75px;
  height: 75px;
  border-bottom: 4px solid #1e830b;
}
.move-buttons button:active {
  position: relative;
  top: 2px;
}

#button-left {
  margin-right: 40px;
}

#button-right {
  margin-left: 40px;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}

.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.disabled:hover {
  animation: shake 0.4s;
  animation-iteration-count: 1;
}

.disabled1 {
  opacity: 0.6;
  cursor: not-allowed;
}

.disabled1:hover {
  animation: shake 0.4s;
  animation-iteration-count: 1;
}