body {
  margin: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: center;
  color: #f4f4f4;
}
canvas {
  display: block;
}
#info {
  position: absolute;
  top: 10px;
  width: 100%;
  text-align: center;
  z-index: 100;
  display: block;
  color: white;
  text-shadow: 2px 2px 4px #000000;
}
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid white;
  transform: translate(-50%, -50%);
  pointer-events: none; /* Prevents the crosshair from blocking clicks */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  z-index: 99;
}
#hotbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 5px;
  z-index: 100;
}
.slot {
  width: 40px;
  height: 40px;
  margin: 0 5px;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.slot.active {
  border-color: #1e90ff;
  transform: scale(1.1);
}
#save-world-btn, #load-world-btn {
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #1e90ff;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    margin: 10px;
    transition: background-color 0.2s;
}
#save-world-btn:hover, #load-world-btn:hover {
    background-color: #1c86e0;
}
/* Block textures - You would need to replace these with actual image paths */
.slot[data-block-id="dirt"] { background-color: #8B4513; }
.slot[data-block-id="stone"] { background-color: #777; }
.slot[data-block-id="wood"] { background-color: #5C4033; }
.slot[data-block-id="grass"] { background-color: #38761D; }
.slot[data-block-id="sand"] { background-color: #F4A460; }
.slot[data-block-id="glass"] { background-color: rgba(135, 206, 235, 0.5); }
.slot[data-block-id="brick"] { background-color: #8B0000; }
.slot[data-block-id="cobblestone"] { background-color: #A9A9A9; }
.slot[data-block-id="obsidian"] { background-color: #1a1a1a; }
.slot[data-block-id="water"] { background-color: #4682B4; }
/* Touch controls styling */
#game-container {
    position: relative;
    width: 100%;
    height: 100vh;
}
#touch-controls {
    position: absolute;
    bottom: 120px;
    width: 100%;
    display: none; /* Hidden by default, shown via JS for touch devices */
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 100;
}
#joystick-container {
    position: relative;
    width: 100px;
    height: 100px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    margin-left: 20px;
    pointer-events: auto;
}
#joystick {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}
.touch-btn {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    color: white;
    pointer-events: auto;
}
#jump-btn {
    margin-right: 20px;
}
#destroy-btn {
    margin-right: 20px;
}
#build-btn {
    margin-right: 20px;
}
.right-controls {
    display: flex;
    align-items: center;
    margin-right: 20px;
}
/* New CSS for ESC button */
#esc-btn {
    display: none; /* Hide by default */
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    z-index: 101;
    pointer-events: auto;
}