* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #87CEEB; font-family: "Segoe UI", Arial, sans-serif; color: #eee;
}

#gameContainer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; }
#gameContainer canvas { display: block; }

/* ---------- Меню ---------- */
#menu {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #6fae5f, #2f4a26);
  z-index: 50;
}
.menu-box {
  background: rgba(0,0,0,0.55); border: 2px solid #6b8c4a; border-radius: 12px;
  padding: 32px 40px; width: 340px; text-align: center;
}
.menu-box h1 { margin: 0 0 18px; letter-spacing: 3px; color: #9fe06a; }
.menu-box label { display: block; text-align: left; font-size: 13px; margin: 12px 0 4px; color: #cdd; }
.menu-box input {
  width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #567;
  background: #11150d; color: #fff; font-size: 15px;
}
#colorPicker { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.swatch {
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  border: 3px solid transparent; transition: transform .1s;
}
.swatch.selected { border-color: #fff; transform: scale(1.15); }
#playBtn {
  margin-top: 20px; width: 100%; padding: 12px; font-size: 17px; font-weight: bold;
  border: none; border-radius: 8px; background: #5fae3d; color: #fff; cursor: pointer;
}
#playBtn:hover { background: #74c94f; }
#playBtn:disabled { background: #555; cursor: not-allowed; }
#menuStatus { margin-top: 10px; font-size: 13px; color: #f4a64a; min-height: 18px; }

/* ---------- HUD ---------- */
.hidden { display: none !important; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#topLeft {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,0.45); border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
#playerCount { font-weight: bold; color: #ffd766; margin-bottom: 4px; }
#controlsHint { color: #ddd; }
#blocksHint { color: #bcd9a8; font-size: 12px; margin-top: 2px; }

/* ---------- Хотбар (выбор блока) ---------- */
#hotbar {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; pointer-events: none;
}
#hotbar .slot {
  pointer-events: auto; cursor: pointer;
  width: 52px; height: 52px; border-radius: 8px;
  background: rgba(0,0,0,0.45); border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; position: relative;
}
#hotbar .slot.selected { border-color: #ffd766; box-shadow: 0 0 8px rgba(255,215,102,0.8); }
#hotbar .slotIcon {
  width: 32px; height: 32px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.4);
}
#hotbar .slotKey {
  position: absolute; top: 2px; left: 5px; font-size: 11px; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
