@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
  margin: 0;
  padding: 0;
  background-color: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  font-family: 'Press Start 2P', cursive;
}

#game-container {
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  width: 800px;
  height: 600px;
  background-color: #5c94fc;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

#ui-layer {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  color: white;
  text-shadow: 2px 2px 0 #000;
  font-size: 16px;
  pointer-events: none;
  z-index: 10;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  z-index: 20;
}

.overlay h1 {
  font-size: 40px;
  color: #ffcc00;
  text-shadow: 4px 4px #cc0000;
  margin-bottom: 20px;
}

.overlay p {
  font-size: 18px;
  line-height: 1.5;
  animation: blink 1s infinite;
}

.controls {
  margin-top: 30px;
  font-size: 12px !important;
  color: #aaa;
  animation: none !important;
}

.hidden {
  display: none !important;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Editor Styles */
#editor-ui {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
  overflow-x: auto;
  z-index: 100;
  border-top: 4px solid #fff;
}

.tool-btn {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border: 2px solid #555;
  cursor: pointer;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #333;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  text-shadow: 1px 1px 0 #000;
}

.tool-btn:hover {
  border-color: #fff;
}

.tool-btn.active {
  border-color: #ffcc00;
  box-shadow: 0 0 10px #ffcc00;
}

/* Colored squares for tools if no image */
.tool-ground { background-color: #5d4037; }
.tool-brick { background-color: #d84315; }
.tool-question { background-color: #fdd835; }
.tool-pipe { background-color: #2e7d32; }
.tool-block { background-color: #795548; }
.tool-goomba { background-color: #5d4037; border-radius: 50%; }
.tool-coin { background-color: #ffb300; border-radius: 50%; }
.tool-eraser { background-color: #ff5252; }

#mode-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: #d32f2f;
  color: white;
  border: 4px solid white;
  padding: 10px;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}

#mode-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

#save-btn {
  margin-left: auto;
  background: #1976d2;
  color: white;
  border: 2px solid white;
  padding: 5px 10px;
  font-family: inherit;
  cursor: pointer;
}
</style>
