* {
  box-sizing: border-box;
  margin: 0; padding: 0;
  font-family: 'Ubuntu', sans-serif;
  user-select: none;
}

body, html {
  width: 100%; height: 100%;
  overflow: hidden;
  background-color: #cdcdcd; /* Base grey Diep.io */
}

/* Canvas needs to be absolute filling the screen */
#game-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 1;
}

/* UI Layer Over Canvas */
#ui-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through except on UI elements */
}

/* Main Menu */
.menu-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(205, 205, 205, 0.4);
  z-index: 100;
  pointer-events: auto;
}

.menu-box {
  text-align: center;
}

.menu-box h1 {
  font-size: 60px;
  color: white;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  margin-bottom: 20px;
}

#username-input {
  padding: 10px 15px;
  font-size: 20px;
  width: 300px;
  text-align: center;
  border: 2px solid #555;
  border-radius: 4px;
  outline: none;
  font-family: 'Ubuntu', sans-serif;
  pointer-events: auto;
}

#play-btn, #back-menu-btn {
  margin-top: 15px;
  padding: 12px 45px;
  font-size: 26px;
  font-weight: bold;
  color: white;
  background-color: #00b2e1;
  border: 4px solid #333;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  pointer-events: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#play-btn:hover, #back-menu-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

#play-btn:active, #back-menu-btn:active {
  transform: scale(0.95);
}

/* Leaderboard */
#leaderboard {
  position: absolute;
  top: 10px; right: 10px;
  width: 200px;
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
  text-shadow: 1px 1px 0 #000;
  border: 2px solid rgba(0,0,0,0.1);
}

/* Minimap */
#minimap-container {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 150px;
  height: 150px;
  background-color: rgba(0, 0, 0, 0.1);
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#minimap {
  width: 100%;
  height: 100%;
}

#leaderboard ol {
  padding-left: 20px;
  margin: 0;
}

/* Score display */
#score-display {
  position: absolute;
  bottom: 60px; /* Above XP bar */
  width: 100%;
  text-align: center;
  color: white;
  font-size: 18px;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* Bottom Center HUD */
#bottom-hud {
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 20px;
}

#class-name {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  margin-bottom: 5px;
}

#xp-bar-container {
  width: 400px;
  height: 20px;
  background-color: #555;
  border: 3px solid #333;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

#xp-bar-fill {
  width: 0%;
  height: 100%;
  background-color: #f6c243;
  transition: width 0.2s linear;
}

#level-text {
  position: absolute;
  top: -2px; left: 0; right: 0;
  text-align: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}

/* Upgrade Panel */
#upgrade-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

#skill-points-banner {
  color: white;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  margin-bottom: 10px;
}

.upgrade-btn-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upgrade-btn {
  width: 250px;
  height: 25px;
  border: 2px solid #555;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  font-size: 12px;
  text-align: left;
  padding: 0 5px;
  cursor: pointer;
  position: relative;
  text-shadow: 1px 1px 0 #000;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
  transition: transform 0.05s;
}

.upgrade-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2);
}

.upgrade-btn .hotkey {
  display: inline-block;
  width: 15px;
}

.stat-bars {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
}

.stat-bar {
  width: 6px;
  height: 12px;
  border: 1px solid #333;
  border-radius: 1px;
}

.stat-bar.filled { background-color: white; }
.stat-bar.empty { background-color: rgba(0,0,0,0.2); }

/* Class Upgrades */
#class-evolution-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  pointer-events: auto;
}

.class-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 350px;
}

.class-btn {
  width: 100px;
  height: 100px;
  background-color: #00b2e1;
  border: 3px solid #333;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 1px 1px 0 #000;
}

.class-btn:hover {
  filter: brightness(1.1);
}

.class-btn canvas {
  margin-bottom: 5px;
}
