:root {
  --bg-color: #050510;
  --text-color: #00ffff;
  --ui-bg: rgba(5, 5, 16, 0.85);
  --ui-border: #00ffff;
  --accent-color: #ff00ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Courier New', Courier, monospace;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

#uiLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass through to canvas by default */
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#btn-home,
#btn-map {
  position: absolute;
  bottom: 80px;
  width: 40px;
  height: 40px;
  background-color: var(--ui-bg);
  border: 1px solid var(--ui-border);
  color: var(--text-color);
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
  display: none;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

#btn-home {
  right: 20px;
}

#btn-map {
  right: 70px;
  font-size: 20px;
}

#btn-home:hover,
#btn-map:hover {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

#toolbar {
  pointer-events: auto;
  background-color: var(--ui-bg);
  border-top: 1px solid var(--ui-border);
  padding: 10px;
  display: none; /* hidden by default in menu */
  gap: 10px;
  justify-content: center;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

.toolbar-btn {
  background-color: transparent;
  border: 1px solid var(--ui-border);
  color: var(--text-color);
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  position: relative;
}

.toolbar-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  padding: 10px 12px;
  background: rgba(5, 5, 16, 0.95);
  border: 1px solid var(--ui-border);
  color: #c9d1d9;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-line;
  text-align: left;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

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

.toolbar-btn.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.5);
}
