* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: linear-gradient(to right, rgb(46, 34, 214), rgb(243, 92, 92));
  font-family: 'VT323', monospace;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px;
}

/* 2:1 canvas scaled to fit the window, pixel art kept crisp */
#canvas1 {
  display: block;
  width: min(1000px, 100%, (100vh - 80px) * 2);
  aspect-ratio: 2 / 1;
  border: 5px solid black;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  image-rendering: pixelated;
  background: #140a2e;
}

.hint {
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.touch {
  display: none;
  width: min(1000px, 100%);
  justify-content: space-between;
  gap: 12px;
}

.pad {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pad:last-child {
  justify-content: flex-end;
  max-width: 60%;
}

.touch button {
  font-family: inherit;
  font-size: 1.3rem;
  min-width: 56px;
  height: 52px;
  padding: 0 10px;
  color: #fff;
  background: rgba(20, 10, 46, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 10px;
}

.touch button.active {
  background: #ff4fa3;
  transform: translateY(2px);
}

@media (pointer: coarse) {
  .touch {
    display: flex;
  }
  .hint {
    display: none;
  }
}

#player,
#layer1,
#layer2,
#layer3,
#layer4,
#layer5,
#enemy_fly,
#enemy_walk,
#enemy_climb,
#fire,
#collisionAnimation,
#oneUp {
  display: none;
}
