:root {
  --bg-color: #1a1a2e;
  --ui-bg: rgba(22, 33, 62, 0.9);
  --accent: #e94560;
  --text: #ffffff;
  --highlight: #0f3460;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text);
  user-select: none;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}

canvas {
  display: block;
}

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

/* HUD */
#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.stat-box {
  background: var(--ui-bg);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  border: 1px solid var(--highlight);
}

.label {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.xp-bar-container {
  width: 200px;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
}

#xp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  transition: width 0.2s;
}

/* Screens */
#level-up-screen, #game-over-screen, #start-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ui-bg);
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 2px solid var(--accent);
  pointer-events: auto;
  min-width: 300px;
}

.hidden {
  display: none !important;
}

h1, h2 {
  margin-top: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  margin-top: 20px;
}

button:hover {
  background: #ff5e78;
  transform: scale(1.05);
}

button:active {
  transform: scale(0.95);
}

/* Upgrade Options */
#upgrade-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.upgrade-card {
  background: var(--highlight);
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border 0.2s;
}

.upgrade-card:hover {
  border-color: var(--accent);
  background: #16213e;
}

.upgrade-title {
  font-weight: bold;
  font-size: 1.1rem;
  color: #fff;
}

.upgrade-desc {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 4px;
}
