:root {
  --primary-color: #2196F3;
  --secondary-color: #4CAF50;
  --accent-color: #FFC107;
  --bg-color: #f0f4f8;
  --text-color: #333;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ui-bg: rgba(255, 255, 255, 0.9);
  --ui-border-radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  touch-action: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

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

canvas {
  display: block;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass through to canvas where needed */
}

/* Enable pointer events for actual UI elements */
#hud, #toolbar, #pause-btn, .menu-screen {
  pointer-events: auto;
}

#hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ui-bg);
  padding: 10px 20px;
  border-radius: var(--ui-border-radius);
  box-shadow: 0 4px 6px var(--shadow-color);
  backdrop-filter: blur(5px);
  display: flex;
  gap: 20px;
  font-weight: bold;
  font-size: 1.1em;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

#toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: var(--ui-bg);
  padding: 10px;
  border-radius: var(--ui-border-radius);
  box-shadow: 0 4px 6px var(--shadow-color);
}

.tool-btn {
  background: white;
  border: 2px solid transparent;
  border-radius: 8px;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  transform: translateY(-2px);
  background: #f8f9fa;
}

.tool-btn.active {
  border-color: var(--primary-color);
  background: #e3f2fd;
}

#pause-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--ui-bg);
  border: none;
  font-size: 24px;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px var(--shadow-color);
}

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

.menu-screen.hidden {
  display: none;
}

.menu-screen h1 {
  font-size: 3em;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  background: linear-gradient(45deg, #FFC107, #FF9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.primary-btn {
  background: linear-gradient(45deg, var(--primary-color), #1976D2);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.2em;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.secondary-btn {
  background: transparent;
  border: 2px solid white;
  color: white;
  padding: 10px 30px;
  font-size: 1em;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.score-display {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: center;
}
