:root {
  --primary-color: #00f3ff;
  --enemy-color: #ff0055;
  --xp-color: #ffd700;
  --bg-color: #050505;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
  user-select: none;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  overflow: hidden;
  font-family: var(--font-family);
  color: white;
}

canvas {
  display: block;
  /* Adding a bloom effect to the entire canvas */
  filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.2));
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass through to canvas */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.level-badge {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-color);
  min-width: 80px;
}

.xp-container {
  flex-grow: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#xp-bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--xp-color);
  box-shadow: 0 0 10px var(--xp-color);
  transition: width 0.2s ease-out;
}

.score-display {
  font-size: 20px;
  font-weight: bold;
  min-width: 150px;
  text-align: right;
}

.hud-bottom {
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
}

.health-container {
  width: 300px;
  height: 20px;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: 4px;
  transform: skewX(-20deg);
  overflow: hidden;
}

#health-bar-fill {
  width: 100%;
  height: 100%;
  background-color: #ff3333;
  box-shadow: 0 0 15px #ff0000;
  transition: width 0.1s linear;
}

/* Screens */
#start-screen, #game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 10;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 64px;
  margin: 0 0 20px 0;
  color: white;
  text-shadow: 4px 4px 0px var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 4px;
}

p {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 40px;
}

button {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 15px 40px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

button:hover {
  background: var(--primary-color);
  color: black;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.6);
}
