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

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

#game-container {
  position: relative;
  /* Maintain NES aspect ratio (256x240) scaled up */
  width: 768px; /* 256 * 3 */
  height: 720px; /* 240 * 3 */
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated; /* Crucial for retro look */
  background-color: #5C94FC; /* Mario Sky Blue */
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#hud {
  display: flex;
  justify-content: space-around;
  padding-top: 20px;
  font-size: 24px;
  text-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
}

.hud-item {
  text-align: center;
}

#start-screen, #game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 48px;
  color: #E75A10; /* Mario Orange */
  text-shadow: 4px 4px 0 #000;
  margin-bottom: 20px;
}

p {
  font-size: 20px;
  animation: blink 1s infinite;
}

button {
  font-family: 'Press Start 2P', cursive;
  font-size: 20px;
  padding: 15px 30px;
  background: #E75A10;
  color: #fff;
  border: 4px solid #fff;
  cursor: pointer;
  text-transform: uppercase;
}

button:hover {
  background: #fff;
  color: #E75A10;
}

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