
/* ===============================
   Global Layout
================================= */
html, body {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Container that fills the CRT screen */
#racer-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top, #3b1f5f 0%, #05010a 60%, #000 100%);
  overflow: hidden;
}

/* Canvas fills the container */
#racer-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ===============================
   HUD (Score + Speed)
================================= */
#hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  color: #ffecff;
  font-size: 16px;
  text-shadow: 0 0 6px #ff00ff;
  z-index: 10;
}

#score, #speed {
  background: rgba(10, 0, 30, 0.7);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 0, 255, 0.4);
}

/* ===============================
   Game Over Screen
================================= */
#game-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.98));
  color: #ffecff;
  text-align: center;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#game-over.show {
  opacity: 1;
  pointer-events: auto;
}

#game-over h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #ff4da6;
  text-shadow: 0 0 10px #ff4da6;
}

#game-over p {
  margin: 5px 0 20px;
  font-size: 18px;
}

#game-over button {
  margin: 5px;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff4da6, #ff9aeb);
  color: #1a001f;
  box-shadow: 0 0 10px #ff4da6;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#game-over button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px #ff9aeb;
}

/* ===============================
   Start Screen
================================= */
#start-screen {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #ffecff;
  text-align: center;
  z-index: 30;
}

#start-screen h2 {
  font-size: 32px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #ff4da6;
}

#start-screen p {
  margin-bottom: 20px;
  font-size: 18px;
}

#start-screen button {
  padding: 10px 20px;
  font-size: 18px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff4da6, #ff9aeb);
  color: #1a001f;
  cursor: pointer;
  box-shadow: 0 0 10px #ff4da6;
}

/* ===============================
   Mobile Tweaks
================================= */
@media (max-width: 600px) {
  #hud {
    font-size: 14px;
  }

  #game-over h2 {
    font-size: 26px;
  }

  #game-over p {
    font-size: 16px;
  }

  #game-over button {
    font-size: 14px;
    padding: 8px 14px;
  }

  #start-screen h2 {
    font-size: 26px;
  }

  #start-screen p {
    font-size: 16px;
  }

  #start-screen button {
    font-size: 16px;
    padding: 8px 16px;
  }
}
